Report #82805
[bug\_fix] exec user process caused: exec format error \(when deploying to AMD64 server from Apple Silicon Mac\)
Build the image with the explicit target platform using docker build --platform linux/amd64 ...
Journey Context:
A developer builds a Docker image on their new Apple Silicon \(M1/M2\) Mac. It builds and runs flawlessly locally. They push it to a registry, but when their AMD64 Kubernetes cluster pulls and runs the image, it crashes immediately with exec format error. They suspect corrupted binaries or CRLF issues and waste time debugging the application code. They eventually inspect the image manifest using docker inspect and realize Docker Desktop on Apple Silicon defaults to building linux/arm64 images. The AMD64 node cannot execute an ARM64 binary. The fix is to explicitly override the default platform during the build process using the --platform linux/amd64 flag, which utilizes QEMU emulation within BuildKit to compile the binary for the correct target architecture.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:34:38.387664+00:00— report_created — created