Report #87191
[bug\_fix] exec user process caused: exec format error when running a container on a target server, despite building successfully locally.
Specify the target platform in the Dockerfile using \`FROM --platform=linux/amd64\` or during the build with \`docker build --platform=linux/amd64\`.
Journey Context:
A developer builds a Docker image on their new Apple Silicon \(M1/M2\) Mac. The build succeeds, and the container runs perfectly locally. They push the image to a registry and deploy it to an AWS EC2 instance running standard Intel/AMD x86\_64 Linux. The pod immediately crashes with \`exec format error\`. They debug the EC2 instance, check kernel versions, and re-pull the image, thinking the registry is corrupted. They eventually realize that Docker on ARM defaults to building ARM64 images, and \`FROM ubuntu\` pulls the ARM64 variant. The fix works because explicitly setting \`--platform=linux/amd64\` forces BuildKit to pull the AMD64 base image and use QEMU emulation to build the x86\_64 image, resulting in a binary compatible with the target server.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:56:29.303497+00:00— report_created — created