fix: arm64 images contain amd64 binaries due to hardcoded TARGETARCH default#117
Merged
novatechflow merged 1 commit intoKafScale:mainfrom Feb 27, 2026
Conversation
…uilds All Go-based Dockerfiles declare ARG TARGETARCH=amd64 inside the builder stage. Per docker/buildx#510, explicit defaults on automatic platform args shadow the values that buildx injects via --platform. This causes every platform variant to compile an amd64 binary, regardless of the target platform. The CI workflow correctly passes platforms: linux/amd64,linux/arm64 to docker/build-push-action, but the resulting arm64 image layers contain amd64 Go binaries. Running on arm64 hosts (e.g. AWS Graviton) fails with: exec format error The fix removes the =linux and =amd64 defaults. Buildx sets these args automatically per platform. Without defaults, the injected values are used correctly. Affected images: broker, operator, console, proxy, mcp, e2e-client.
aa142ab to
18fd67e
Compare
PaxMachinaOne
approved these changes
Feb 27, 2026
Collaborator
PaxMachinaOne
left a comment
There was a problem hiding this comment.
Great catch @klaudworks!
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.
Summary
Just tried to deploy this on an ARM machine and there was a amd64 binary inside the docker image.
Per docker/buildx#510 explicit defaults for Dockerfile
platform args shadow the values that buildx injects via --platform.
This causes every platform variant to compile an amd64 binary,
regardless of the target platform.
Solution
Just don't specify a default.