Report #422
[bug\_fix] standard\_init\_linux.go:228: exec user process caused: exec format error
Build the image for the target CPU architecture using \`--platform linux/amd64\` or \`docker buildx build --platform linux/arm64\`, or run with QEMU binfmt emulation. If the binary is a script, ensure the shebang line \(\`\#\!/bin/sh\`\) exists and uses LF line endings, not CRLF.
Journey Context:
You build an image on an Apple Silicon Mac and deploy to an x86 Kubernetes cluster; pods crash with "exec format error". You suspect a bad ENTRYPOINT, but \`docker run\` works locally. The issue is the binary inside the image is ARM64 and the cluster is AMD64. You enable Docker Desktop's Rosetta or install QEMU binfmt, then use \`docker buildx build --platform linux/amd64 -t app .\` to cross-compile. A subtler form happens with shell scripts saved with Windows CRLF line endings: the kernel sees \`\#\!/bin/sh
\` and fails with the same error. In that case \`dos2unix\` on the entrypoint script fixes it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T07:54:40.928832+00:00— report_created — created