Skip to content

Publish multi-arch Docker image (amd64 + arm64)#1253

Merged
nickvanw merged 3 commits intomainfrom
nick/docker-multiarch
Apr 22, 2026
Merged

Publish multi-arch Docker image (amd64 + arm64)#1253
nickvanw merged 3 commits intomainfrom
nick/docker-multiarch

Conversation

@nickvanw
Copy link
Copy Markdown
Contributor

Summary

  • Extends the goreleaser dockers block into two arch-specific builds (amd64 + arm64) and combines them with a docker_manifests block so planetscale/pscale:latest and planetscale/pscale:{{ .Tag }} become multi-arch manifests.
  • Adds docker/setup-qemu-action + docker/setup-buildx-action to the release workflow so the host has QEMU emulators and a buildx builder registered before goreleaser invokes docker buildx over the mounted socket.

Why

The image has been amd64-only since it was first published, which forces arm64 users (Apple Silicon laptops, Graviton hosts, arm64 CI runners) to run it under emulation — slow, and it breaks entirely in environments that block cross-arch execution. The linux/arm64 binary has been produced by goreleaser for a while, so the binary is essentially free; only the Docker publish path was missing.

Dockerfile.goreleaser is already arch-neutral (just COPYs the binary into ubuntu:noble, which has both amd64 and arm64 images), so no Dockerfile changes were needed.

Fixes #1252

The planetscale/pscale Docker image was only published for linux/amd64,
which forced arm64 users (Apple Silicon, Graviton, etc.) to run it under
emulation. The linux/arm64 binary is already produced by goreleaser, so
this wires that binary into a second Docker build and combines the two
arch-specific tags into a multi-arch manifest.

Also adds docker/setup-qemu-action and docker/setup-buildx-action to the
release workflow so the host has buildx + QEMU registered before the
goreleaser container invokes `docker buildx` against the mounted socket.

Fixes #1252
@nickvanw nickvanw requested a review from a team as a code owner April 22, 2026 17:02
goreleaser with `use: buildx` requires an active docker-container
builder, but goreleaser runs inside the goreleaser-cross container while
setup-buildx-action configures the builder on the host — the buildx
client config at ~/.docker/buildx/ is not shared, so the in-container
buildx CLI starts with only the default docker driver and cannot
satisfy --platform builds the way goreleaser invokes them.

Add an entrypoint script that creates and selects a docker-container
buildx builder on first invocation, so goreleaser sees a proper builder
when it runs. setup-qemu-action is kept on the host (binfmt handlers
are kernel-level and inherited), but setup-buildx-action is dropped as
it has no effect on the container's buildx state.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7abdf80. Configure here.

Comment thread docker/Dockerfile.goreleaser Outdated
The previous commit replaced the goreleaser-cross base entrypoint,
which also handled docker login (via DOCKER_CREDS_FILE, passed by the
Makefile), GPG key import, git safe.directory, and CC/CXX setup for
CGO. Without that setup, the release would fail to push images to
Docker Hub.

Move the base entrypoint to /base-entrypoint.sh and have our wrapper
exec it after configuring buildx. Also restore tini as PID 1 to match
the base image's signal handling.
@nickvanw nickvanw merged commit 4149d66 into main Apr 22, 2026
4 checks passed
@nickvanw nickvanw deleted the nick/docker-multiarch branch April 22, 2026 18:06
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.

Add linux/arm64 support to planetscale/pscale image

2 participants