Repository navigation
[all] Build cross platform docker images and build linux amd64+arm64 - #4194
Open
robskillington wants to merge 3 commits into
Open
robskillington wants to merge 3 commits into
robskillington wants to merge 3 commits into
Conversation
…e calls from dockerfiles /build-docker
justinhwang
added a commit
to m3db/ci-scripts
that referenced
this pull request
Sep 24, 2026
build.sh used to `docker build` a single-arch image, read its ID from an iidfile, then `docker tag` and `docker push` each tag. A multi-platform buildx build never lands in the local daemon, so that tag/push loop has nothing to operate on. Replace it with one `docker buildx build --push` per image that carries every tag as a `-t` flag. - Register QEMU binfmt handlers and create a docker-container builder (DOCKER_BUILDER_NAME, default m3-multi-platform-builder) if missing. - Platforms come from DOCKER_PLATFORMS, default linux/amd64,linux/arm64. - DRYRUN builds every platform with push=false instead of pushing. - --provenance=false keeps the pushed index to the real platforms only. - Replace the `docker images | grep | rmi` cleanup, which is dead under buildx, with `docker buildx prune` for the builder's cache. Supersedes the build.sh change on the r/cross-platform-docker-builder branch (m3db/m3#4194), which kept the iidfile/tag/push flow. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
justinhwang
added a commit
that referenced
this pull request
Sep 24, 2026
…ges (#4442) * [build] Release linux/darwin arm64 binaries and multi-arch docker images Supersedes the stale #4171 and #4194. goreleaser: - Add arm64 to every build's goarch so releases ship {linux,darwin}_{amd64,arm64} tarballs. - Move to goreleaser v2 (image v2.18.2, `version: 2`, `--clean` instead of the removed `--rm-dist`, `formats:` instead of the deprecated `format:`). The old v1.8.3 image bundles Go 1.18 and cannot build a go 1.26 module. Docker: - Build stage runs on $BUILDPLATFORM and cross-compiles with GOOS=$TARGETOS GOARCH=$TARGETARCH, so `docker buildx --platform linux/amd64,linux/arm64` produces native binaries for both without running the Go build under QEMU. Replaces the hardcoded `make <svc>-linux-amd64`. - Align the m3coordinator release image with the others (alpine 3.20). Makefile: - Add LINUX_ARM64_ENV and <svc>/<tool>/services/tools-linux-arm64 targets mirroring the existing amd64 ones. Submodule: - Bump .ci to m3db/ci-scripts#113, which rewrites docker/build.sh to a single multi-arch `docker buildx build --push` per image. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This adds ability to build cross platform docker images for both amd64 and arm64. e.g. Running M3 on AWS Graviton instances and/or Apple M1 chips.
So far have been using this for one off builds by pushing this branch with a trailing "/build-docker" in the commit message, but opening this for longer term merging. Most of the build change comes from the
.ci/build.shscript, it's possible to branch from this branch and comment out the most of the CI jobs in.buildkite/pipeline.ymladd "/build-docker" to the commit messages and push it to achieve a multi-arch build of any arbitrary commit/branch/tag from the repo.Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: