Report #45920
[bug\_fix] standard\_init\_linux.go:228: exec user process caused: exec format error
Ensure the image is built for the target host's architecture \(e.g., use docker build --platform linux/amd64 when deploying to an AMD64 cloud server from an ARM64 Mac\). Alternatively, if running a shell script, ensure it has a valid shebang \(e.g., \#\!/bin/bash\) and that the script uses LF \(Linux\) line endings instead of CRLF \(Windows\).
Journey Context:
A developer builds a Docker image on their new Apple Silicon \(ARM64\) Mac and pushes it to a registry. When the CI/CD pipeline deploys it to an AWS EC2 AMD64 instance, the container crashes instantly with 'exec format error'. The developer initially suspects a corrupted binary or missing dependencies, rebuilding the image multiple times. They then try running the image locally and it works perfectly. The breakthrough comes when they run uname -m inside the container locally and see aarch64. They realize Docker Desktop builds ARM64 images by default on Apple Silicon, and the AMD64 Linux host cannot execute the ARM64 binary. They fix it by explicitly passing --platform linux/amd64 to the docker build command, or by setting up docker buildx for multi-architecture builds. In a parallel scenario, the same error occurs on Linux due to a Windows-generated entrypoint script with CRLF line endings, causing the shebang \#\!/bin/bash\\r to fail; fixing the line endings to LF resolves it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:33:04.534398+00:00— report_created — created