Report #87385
[bug\_fix] exec user process caused: exec format error when running the container
Build the image for the correct target platform using \`--platform\` in the \`FROM\` statement \(e.g., \`FROM --platform=linux/amd64 node:14\`\) or by passing \`--platform linux/amd64\` to the \`docker build\` command.
Journey Context:
A developer builds a Docker image on their Apple Silicon \(M1/M2\) Mac. It builds successfully and runs fine locally. However, when they push the image to a registry and deploy it to an AWS EC2 instance running on an AMD64 CPU, the container crashes immediately with 'exec format error'. They are confused because the image worked locally. They discover that Docker on Apple Silicon defaults to building \`linux/arm64\` images. The AMD64 host cannot execute the ARM64 binary. They fix it by explicitly building for the target architecture using \`docker build --platform linux/amd64 -t myapp .\`, ensuring the binary inside the container matches the production server's CPU architecture.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:15:55.686717+00:00— report_created — created