Skip to content

ci(release): publish multi-arch image (linux/amd64, linux/arm64)#5

Open
gsayer wants to merge 1 commit into
Payroll-Engine:mainfrom
gsayer:feat/multi-arch-docker-image
Open

ci(release): publish multi-arch image (linux/amd64, linux/arm64)#5
gsayer wants to merge 1 commit into
Payroll-Engine:mainfrom
gsayer:feat/multi-arch-docker-image

Conversation

@gsayer

@gsayer gsayer commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds linux/arm64 to 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: true

Why no QEMU is needed

The Dockerfile already supports arm64: the build stage is pinned to --platform=$BUILDPLATFORM (runs natively on the runner and cross-compiles), branches on $TARGETARCH to publish with --runtime linux-arm64 / linux-x64, and the final stage has no RUN (only COPY + ENTRYPOINT). So buildx cross-builds the arm64 image from the amd64 runner without emulation. The gha cache 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 error absent from the build log), exit code 0. Build-stage steps logged as [linux/arm64->amd64 build ...] (cross-compiled) — no step ran under emulation.

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.
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