Skip to content

Build the arm64 images with an arm64 binary - #11

Merged
zhanghaohit merged 2 commits into
mainfrom
fix/arm64-binary
Oct 28, 2026
Merged

zhanghaohit merged 2 commits into
mainfrom
fix/arm64-binary

Conversation

@zhanghaohit

Copy link
Copy Markdown
Collaborator

Problem

The published linux/arm64 image of 4pdosc/autoconfig, autoconfig-reload and autoconfig-hagate contains an amd64 binary, so it cannot start on arm64 nodes. The Dockerfiles hardcode GOARCH=amd64; the release workflow builds arm64 under QEMU, where that build still succeeds.

Checked on the registry by reading the ELF header of the entrypoint in each platform of the index (all three images, :latest = 0.4.1): the arm64 entry is x86-64.

Change

  • The Dockerfiles take GOARCH from TARGETARCH, which buildx sets to the platform being built. A plain docker build leaves it empty and Go builds for the host, as before.
  • New image-check workflow on pull requests: builds every image for linux/amd64 and linux/arm64 and fails if the binary's ELF machine does not match the platform. Nothing is pushed.

Testing

The check was pushed first on its own, against the unchanged Dockerfiles, to confirm it fails on arm64; the fix follows in the next commit and the check passes. Once a release is cut, the published arm64 image should report AArch64.

The release workflow builds linux/amd64 and linux/arm64, but under QEMU an
arm64 build succeeds even when the Dockerfile compiles for amd64, and the
published arm64 image then cannot start. On pull requests, build every
image for both platforms and compare the ELF machine of the binary inside
with the platform. Nothing is pushed.
The three Dockerfiles hardcoded GOARCH=amd64, so the linux/arm64 images of
autoconfig, autoconfig-reload and autoconfig-hagate published by the
multi-platform release build contained amd64 binaries and could not start
on arm64 nodes. Take GOARCH from TARGETARCH, which buildx sets to the
platform being built; a plain docker build leaves it empty and Go builds
for the host as before.
@zhanghaohit
zhanghaohit merged commit 8878d1c into main Oct 28, 2026
3 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