Report #51637
[bug\_fix] exec user process caused: exec format error
Build the image with the target platform flag \`--platform linux/amd64\` \(e.g., \`docker build --platform linux/amd64 -t myapp .\`\) or set the environment variable \`DOCKER\_DEFAULT\_PLATFORM=linux/amd64\`.
Journey Context:
A developer working on an Apple Silicon \(M1/M2\) Mac builds a Docker image locally and pushes it to a registry. When the CI/CD pipeline or a cloud provider \(like AWS ECS or standard Kubernetes nodes\) tries to run the container, it immediately crashes with 'exec format error'. The developer initially suspects corrupted image layers or a broken registry push. They pull the image back locally and it runs perfectly. After diving into architecture logs, they realize their local Docker defaults to building ARM64 images, while the cloud nodes are running AMD64. The 'exec format error' is the Linux kernel rejecting a binary compiled for a different CPU architecture. Adding the platform flag instructs BuildKit to use QEMU emulation or cross-compilation to build the correct architecture, resolving the mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:10:04.267150+00:00— report_created — created