Skip to content

Build the Docker image without emulation - #5

Merged
FabioHAraujo merged 1 commit into
mainfrom
build/native-docker
Oct 23, 2026
Merged

FabioHAraujo merged 1 commit into
mainfrom
build/native-docker

Conversation

@FabioHAraujo

Copy link
Copy Markdown
Contributor

The release workflow built the multi-arch image by running the whole Dockerfile once per platform, the arm64 half under QEMU: the SvelteKit UI (~4,000 Svelte files) and the Go compile ran in emulated Node and Go. The v0.2.2 image job went past 55 minutes (earlier versions took 6–12).

  • The UI and Go stages run on BUILDPLATFORM (the runner's own architecture). The UI output is identical for every platform; Go cross-compiles with GOOS/GOARCH from TARGETOS/TARGETARCH.
  • The final distroless stage only copies files, so no emulation is needed at all; the setup-qemu-action step is removed.
  • Tested on the dev server with docker buildx build --no-cache: linux/amd64 in 72 s, linux/arm64 in 82 s; the arm64 image's binary is AArch64 and the amd64 one runs (lowlex version).

The PR CI does not build the image (that job runs only on tags), so the first real check is the next release tag.

The multi-arch image ran the whole build twice, the arm64 half under QEMU:
the SvelteKit UI (about 4,000 Svelte files) and the Go compile in emulated
Node and Go. The v0.2.2 image job ran past 55 minutes.

Both build stages now run on the build machine's platform (BUILDPLATFORM):
the UI is the same files for every architecture and Go cross-compiles with
GOOS/GOARCH from TARGETPLATFORM. The final stage only copies files, so the
QEMU setup step is gone. Without cache: amd64 72 s, arm64 82 s.
@FabioHAraujo
FabioHAraujo merged commit a48e648 into main Oct 23, 2026
6 checks passed
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