You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docker: arm64 image built with wrong base architecture (BUILDPLATFORM instead of TARGETPLATFORM) #10581
docker/Dockerfile pins its FROM instruction to --platform=${BUILDPLATFORM}:
FROM --platform=${BUILDPLATFORM} debian:stable-slim
Goreleaser's dockers config builds each architecture via buildx with an explicit --platform build flag (linux/amd64 and linux/arm64, see .goreleaser.yml). BUILDPLATFORM is the platform of the machine running the build (the CI runner), not the platform requested via --platform. On an amd64 CI runner, this means the debian:stable-slim base layer for the image tagged arm64 is actually pulled for linux/amd64, while the updatecli binary copied into it is the arm64 build. The resulting image is tagged/labeled as linux/arm64 but its base OS and system packages are amd64.
Impact
The *-arm64 tags of updatecli/updatecli and ghcr.io/updatecli/updatecli do not contain a consistent arm64 root filesystem, only an arm64 updatecli binary layered on an amd64 base.
Reproduction / evidence
Building docker/Dockerfile with buildx targeting a platform other than the build host's platform shows the mismatch:
The image manifest reports amd64, but the debian package database inside the image reports arm64 (the build host's architecture) — confirming the base layer was pulled for BUILDPLATFORM, not the requested target.
Fix
Use --platform=${TARGETPLATFORM} instead, so the base image matches the platform actually being built:
FROM --platform=${TARGETPLATFORM} debian:stable-slim
Activity