Skip to content

feat: add ARM64 support for Docker images and binary releases (#159)#307

Open
Makennsky wants to merge 2 commits into
moov-io:masterfrom
Makennsky:arm64-support
Open

feat: add ARM64 support for Docker images and binary releases (#159)#307
Makennsky wants to merge 2 commits into
moov-io:masterfrom
Makennsky:arm64-support

Conversation

@Makennsky

Copy link
Copy Markdown

Changes

  • Add ARM64 binary to release artifacts (cross-compiled with CGO_ENABLED=0)
  • Replace single Docker job with matrix build using native ARM64 runners (ubuntu-24.04-arm)
  • Add docker-manifest job to create multi-arch Docker images
  • Add dist-arm64 and docker-multiarch Makefile targets

Why Are Changes Being Made

Adds ARM64 support as requested by @adamdecaf in #159. Uses GitHub's native ARM64 runners for fast builds instead of slow QEMU emulation.

@Makennsky Makennsky requested a review from adamdecaf as a code owner April 27, 2026 07:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new Makefile targets for ARM64 distribution and multi-architecture Docker builds. Feedback focuses on improving build reliability by adding missing dependencies, standardizing package paths, and ensuring Docker images are correctly tagged and exported.

Comment thread Makefile Outdated
Comment on lines +103 to +104
dist-arm64: clean
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "-X github.com/moov-io/achgateway.Version=${VERSION}" -o bin/achgateway-linux-arm64 ./cmd/achgateway/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The dist-arm64 target should include update as a dependency to ensure the vendor directory is populated before the build starts. Additionally, for consistency with the build target (line 30), it is recommended to use the full package path instead of a relative path.

Note: This target uses CGO_ENABLED=0, whereas the AMD64 dist target (line 100) uses CGO_ENABLED=1. This inconsistency can lead to differences in binary behavior (e.g., networking/DNS resolution). Consider standardizing CGO_ENABLED across distribution targets if possible.

dist-arm64: update clean
	CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "-X github.com/moov-io/achgateway.Version=${VERSION}" -o bin/achgateway-linux-arm64 github.com/moov-io/achgateway/cmd/achgateway

Comment thread Makefile Outdated
Comment on lines +106 to +107
docker-multiarch: update
docker buildx build --platform linux/amd64,linux/arm64 --build-arg VERSION=${VERSION} -t moov/achgateway:${VERSION} -f Dockerfile .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The docker-multiarch target is missing the latest tag, which is present in the standard docker target (line 53). Adding it ensures consistency across image builds. Also, including the --pull flag ensures the base image is up to date.

Furthermore, docker buildx build with multiple platforms requires an explicit output destination like --push to a registry or a custom exporter. Without such a flag, the multi-arch manifest and images are not saved to the local Docker daemon's image list.

docker-multiarch: update
	docker buildx build --pull --platform linux/amd64,linux/arm64 --build-arg VERSION=${VERSION} -t moov/achgateway:${VERSION} -t moov/achgateway:latest -f Dockerfile .

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