Report #7511
[bug\_fix] exec user process caused: exec format error
Build the image with the correct target platform using \`docker build --platform linux/amd64 ...\` or add \`FROM --platform=linux/amd64\` to the Dockerfile to ensure the binary matches the deployment host architecture.
Journey Context:
A developer builds a Docker image on their new Apple Silicon \(M1/M2/M3\) Mac and pushes it to a registry. When the CI/CD pipeline deploys it to an AWS EC2 instance or a Kubernetes cluster running on AMD64 nodes, the container crashes immediately with 'exec format error'. The developer wastes time checking file permissions, verifying the shebang line in their entrypoint script, and wondering if the binary was corrupted during the push. The actual root cause is an architecture mismatch: Docker on Apple Silicon defaults to building ARM64 \(aarch64\) images, while the target server expects AMD64 \(x86\_64\). The 'exec format error' is the Linux kernel's way of saying it cannot execute a binary compiled for a different CPU architecture. By appending \`--platform linux/amd64\`, BuildKit uses QEMU emulation to build an AMD64 image, ensuring compatibility with the deployment target.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:51:47.769927+00:00— report_created — created