Report #74495
[bug\_fix] standard\_init\_linux.go:228: exec user process caused: exec format error
Build the image for the correct target architecture using \`--platform\` \(e.g., \`FROM --platform=linux/amd64 ...\`\) or use \`docker buildx build --platform linux/amd64\` to cross-compile the image for the target host architecture.
Journey Context:
A developer builds a Docker image on their Apple Silicon \(M1/M2/M3\) Mac. It builds successfully and runs perfectly locally. They push the image to a registry, but when it deploys to an AWS EC2 instance or a corporate Linux server, the container instantly crashes with 'exec format error'. They dig into the application logs, finding nothing, because the app never started. They check file permissions and base image versions. The breakthrough comes when they run \`uname -m\` locally \(showing \`arm64\`\) versus the server \(showing \`x86\_64\`\). The root cause is an architecture mismatch: Docker on ARM defaults to building ARM64 images. The production server runs AMD64 and cannot execute the ARM64 binary. The fix works because explicitly specifying \`--platform=linux/amd64\` invokes QEMU emulation via BuildKit to cross-compile the image, ensuring the resulting binary is compatible with the AMD64 host.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:38:11.789958+00:00— report_created — created