ci(release): publish multi-arch image (linux/amd64, linux/arm64)#2
Open
gsayer wants to merge 1 commit into
Open
ci(release): publish multi-arch image (linux/amd64, linux/arm64)#2gsayer wants to merge 1 commit into
gsayer wants to merge 1 commit into
Conversation
The release workflow built for the runner arch only (amd64) and the Dockerfile was not arch-aware. Align it with the Backend/WebApp pattern: pin the build stage to $BUILDPLATFORM and branch restore/publish on $TARGETARCH (--runtime linux-arm64|linux-x64 --self-contained false). The final stage has no RUN, so buildx cross-builds the arm64 image from the amd64 runner with no QEMU. Add platforms to the build-push step. 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
Publishes the PayrollConsole image as multi-arch (
linux/amd64+linux/arm64) instead of amd64-only, so it runs natively on arm64 hosts / Apple Silicon instead of under slow QEMU emulation. Same goal as PayrollEngine.Backend#18 and the WebApp PR.Unlike Backend/WebApp, the Console
Dockerfilewas not yet arch-aware, so this PR also adapts it to the same pattern you already use there.Changes
1.
Dockerfile— adopt the Backend/WebApp cross-build pattern:--platform=$BUILDPLATFORM(+ARG TARGETARCH/ARG BUILDPLATFORM);restoreandpublishon$TARGETARCHwith--runtime linux-arm64/linux-x64 --self-contained false.The final stage already has no
RUN(onlyCOPY+ENTRYPOINT), so the build stage runs natively on the runner and cross-compiles — no QEMU.2.
.github/workflows/release.yml— one line:with: context: . + platforms: linux/amd64,linux/arm64 push: trueVerified locally
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. Built withNUGET_SOURCE=nuget.org(as an external consumer, no GitHub Packages token).