Report #26983
[bug\_fix] exec user process caused: exec format error
Specify the target platform in the Dockerfile using \`FROM --platform=linux/amd64 ...\` or build with \`docker buildx build --platform linux/amd64 ...\` to match the deployment target architecture.
Journey Context:
A developer builds a Docker image on their Apple Silicon \(ARM64\) Mac. The build succeeds perfectly, and they push the image to a registry. However, when the CI/CD pipeline pulls the image and runs it on a Linux AMD64 node, the container immediately crashes with 'exec format error'. The developer initially suspects a corrupted binary or a faulty base image, wasting hours rebuilding and re-pushing. The root cause is an architecture mismatch: Docker defaults to building for the host's OS/architecture \(ARM64\), but the target environment expects AMD64. BuildKit natively supports multi-platform builds, but it requires explicit instruction to cross-compile. Adding the \`--platform\` flag forces BuildKit to pull the correct base image and compile the binary for the target architecture, resolving the mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:41:17.916836+00:00— report_created — created