ci(release): publish multi-arch image (linux/amd64, linux/arm64)#5
Open
gsayer wants to merge 1 commit into
Open
ci(release): publish multi-arch image (linux/amd64, linux/arm64)#5gsayer wants to merge 1 commit into
gsayer wants to merge 1 commit into
Conversation
The release workflow's build-push step had no platforms input, so buildx built for the runner arch only (amd64). The Dockerfile already supports arm64 (build stage on $BUILDPLATFORM, RID-specific publish via $TARGETARCH, RUN-free final stage), so emitting both platforms needs no QEMU — the arm64 image is cross-built from the amd64 runner. Verified locally: buildx --platform linux/amd64,linux/arm64 produces a multi-arch manifest list with no emulation.
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
Adds
linux/arm64to the published image so the WebApp image ships a multi-arch manifest instead of amd64-only — same change as PayrollEngine.Backend#18.The change (one line)
- name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . + platforms: linux/amd64,linux/arm64 push: trueWhy no QEMU is needed
The
Dockerfilealready supports arm64: the build stage is pinned to--platform=$BUILDPLATFORM(runs natively on the runner and cross-compiles), branches on$TARGETARCHto publish with--runtime linux-arm64/linux-x64, and the final stage has noRUN(onlyCOPY+ENTRYPOINT). So buildx cross-builds the arm64 image from the amd64 runner without emulation. Theghacache still works per-platform.Verified locally
Ran the exact buildx invocation the workflow uses, for both platforms, with
NUGET_SOURCE=nuget.org(as an external consumer, no GitHub Packages token):docker buildx build --platform linux/amd64,linux/arm64 \ --build-arg NUGET_SOURCE=nuget.org \ --output type=oci,dest=out.tar .Result — a proper multi-arch manifest list (
linux/amd64+linux/arm64), no QEMU (qemu/exec format errorabsent from the build log), exit code 0. Build-stage steps logged as[linux/arm64->amd64 build ...](cross-compiled) — no step ran under emulation.