Skip to content

build(marketplace): cross-compile minio for arm64 via TARGETARCH - #2

Merged
inkme9 merged 1 commit into
release/2025-10-15-go1.25.9from
fix/marketplace-dockerfile-multiarch
Jun 11, 2026
Merged

inkme9 merged 1 commit into
release/2025-10-15-go1.25.9from
fix/marketplace-dockerfile-multiarch

Conversation

@inkme9

@inkme9 inkme9 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why

The GCP Marketplace listing requires arm64 images, but Dockerfile.marketplace
hardcoded GOARCH=amd64 — so docker buildx --platform linux/amd64,linux/arm64
produced an amd64 binary for both platforms.

What

  • Pin the build stage to --platform=$BUILDPLATFORM and cross-compile the Go
    binary to ${TARGETARCH} (injected by buildx). CGO_ENABLED=0 is already set,
    so cross-compilation needs no cross toolchain and avoids slow QEMU emulation.
  • Enables linux/amd64,linux/arm64 multiarch builds for the Marketplace image.

Dockerfile.marketplace hardcoded GOARCH=amd64, so buildx could not produce
arm64 images. Pin the build stage to BUILDPLATFORM and cross-compile to
TARGETARCH (CGO is disabled, so no cross toolchain / QEMU needed), enabling
linux/amd64,linux/arm64 multiarch builds for the GCP Marketplace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@inkme9 inkme9 self-assigned this Jun 11, 2026
@inkme9
inkme9 merged commit 7f244e4 into release/2025-10-15-go1.25.9 Jun 11, 2026
1 check passed
@inkme9
inkme9 deleted the fix/marketplace-dockerfile-multiarch branch June 11, 2026 02:00
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.

1 participant