Report #13697
[bug\_fix] docker buildx build --platform linux/amd64,linux/arm64 fails on a RUN step that works perfectly for a single platform build
Ensure the base image in the FROM instruction supports all requested platforms via a multi-arch manifest. Avoid hardcoding architecture-specific commands or paths in RUN instructions; use Docker automatic platform ARGs like TARGETARCH for architecture-specific steps.
Journey Context:
Developer sets up a multi-architecture build pipeline using docker buildx. The build succeeds for linux/amd64 but fails for linux/arm64 with an error like 'exec format error' during a RUN step, or fails entirely. They investigate and find that their FROM statement uses a specific image that only has an AMD64 manifest, or a RUN step downloads a pre-compiled binary \(like a specific release of a tool from GitHub\) compiled only for x86\_64. The fix works by replacing hardcoded architecture assumptions with Docker's built-in TARGETARCH ARG \(e.g., ARG TARGETARCH then RUN wget https://example.com/tool-$\{TARGETARCH\}.tar.gz\), and ensuring the base image is a multi-architecture manifest image \(like python:3.9 rather than python:3.9-amd64\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:25:42.534708+00:00— report_created — created