Skip to content

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

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)#2
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

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 Dockerfile was 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:

  • pin the build stage to --platform=$BUILDPLATFORM (+ ARG TARGETARCH / ARG BUILDPLATFORM);
  • branch restore and publish on $TARGETARCH with --runtime linux-arm64 / linux-x64 --self-contained false.

The final stage already has no RUN (only COPY + 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: true

Verified 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 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. Built with NUGET_SOURCE=nuget.org (as an external consumer, no GitHub Packages token).

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