Report #96512
[bug\_fix] exec user process caused: exec format error
Build the image with the correct target architecture using the \`--platform linux/amd64\` flag \(or the appropriate target architecture\) in the \`docker build\` command, or set \`DOCKER\_DEFAULT\_PLATFORM=linux/amd64\`.
Journey Context:
A developer working on an Apple Silicon \(M1/M2\) Mac builds a Docker image and pushes it to AWS ECR. When the ECS task starts, the container immediately crashes with \`exec user process caused: exec format error\`. The developer goes down a rabbit hole investigating whether the Node.js or Python binary is corrupted, or if there's a missing shebang in their entrypoint script. They rebuild locally and it runs perfectly. The breakthrough comes when they check the architecture of the built image using \`docker inspect\` and see \`arm64\`. The AWS ECS node is an Intel/x86\_64 instance. By default, Docker on Apple Silicon builds \`linux/arm64\` images. The \`exec format error\` is the Linux kernel's way of saying 'I cannot execute a binary compiled for a different CPU architecture'. Adding \`--platform linux/amd64\` to the build command forces Docker to emulate the target architecture, producing a compatible image.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:34:45.917254+00:00— report_created — created