Repository navigation
build(docker): compile for the target platform (KG-02) - #48
Merged
Merged
Conversation
The builder stage forced GOOS=linux GOARCH=amd64, so an arm64 image built by `docker buildx build --platform linux/amd64,linux/arm64` carried an amd64 binary. The builder now runs on $BUILDPLATFORM and cross-compiles with the TARGETOS/TARGETARCH that BuildKit sets from --platform. A plain `docker build` (make docker, compose) keeps building for the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PaxMachinaOne
approved these changes
Dec 3, 2026
PaxMachinaOne
left a comment
Member
There was a problem hiding this comment.
Looks good — files in the low-risk gate, checks green.
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
deploy/Dockerfile: the builder stage runs on$BUILDPLATFORMand compiles withGOOS=${TARGETOS} GOARCH=${TARGETARCH}instead of the fixedGOOS=linux GOARCH=amd64. Before, an arm64 image fromdocker buildx build --platform linux/amd64,linux/arm64carried an amd64 binary. The distribution builds both platforms.make docker, the compose files anddocker.ymlbuild with BuildKit, which setsTARGETOS/TARGETARCHto the host platform when no--platformis given. Their behaviour does not change.Checked locally (Docker 27.5.1 with BuildKit, amd64 host)
docker build -f deploy/Dockerfile .(asmake docker)linux/amd64,/usr/local/bin/kafgraphisELF 64-bit, x86-64docker buildx build --platform linux/amd64ELF 64-bit, x86-64docker buildx build --platform linux/arm64ELF 64-bit, ARM aarch64; the builder ran natively on amd64For the builder-stage checks, a copy of the Dockerfile got one extra stage (
FROM scratch+COPY --from=builder /app/kafgraph) to export the binary. The Dockerfile in this PR has no such stage.Not checked yet
The full two-platform build of the KG-02 "done when" (
--platform linux/amd64,linux/arm64, both images) has not run. The runtime stage runsapk add/adduserand needs arm64 emulation (QEMU/binfmt), which this host does not have, and the localdockerdriver cannot build several platforms at once. KG-03 adds that build to CI on GitHub-hosted runners. Until then, KG-02 stays open after the merge.Ref: KG-02
🤖 Generated with Claude Code