Skip to content

Multi-architecture support for s3-resource Dockerfile #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

analytically
Copy link

@analytically analytically commented Apr 12, 2025

Related to concourse/concourse#9183

Updated the Dockerfile to support multi-architecture builds. Key changes:

  • Added TARGETOS and TARGETARCH arguments for cross-compilation
  • Set builder to use BUILDPLATFORM for faster builds
  • Configured Go builds with explicit GOOS/GOARCH for target platforms
  • Updated package management for Chainguard base image
  • Maintained test execution in the appropriate target environment

This enables building the s3-resource container for multiple architectures (amd64, arm64, etc.) from a single build pipeline.

Enhanced the Dockerfile with multi-architecture support using Docker BuildX.
Key changes:
- Added TARGETOS and TARGETARCH arguments for cross-compilation
- Utilized BUILDPLATFORM for efficient builder image compilation
- Set explicit GOOS/GOARCH/GOAMD64/GOARM64 flags for optimized binaries
- Updated package management for Chainguard base image
- Preserved test execution in target-specific environments

This enables building optimized s3-resource containers for multiple architectures
(amd64, arm64) from a single build pipeline, with architecture-specific instruction
set targeting.

Signed-off-by: Mathias Bogaert <[email protected]>
and the TARGET{OS/ARCH} as Go will figure that out from the platform
specified by buildkit.

Changed the builder_image to concourse/golang-builder as we set some
non-default stuff in that image. See the concourse/ci repo for the
Dockerfile for that image.

Signed-off-by: Taylor Silva <[email protected]>
@taylorsilva taylorsilva marked this pull request as draft April 18, 2025 20:56
@taylorsilva
Copy link
Member

taylorsilva commented Apr 18, 2025

Changed PR to a draft until the ci pipeline stuff is ready. Added a commit to clean some stuff. See commit message for details.
Also linked to the tracking issue in the main repo.

tzdata \
unzip \
zip && \
rm -rf /var/cache/apk/*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this when using --no-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants