Report #69787
[bug\_fix] standard\_init\_linux.go:228: exec user process caused: exec format error
Convert the entrypoint script line endings from CRLF \(Windows\) to LF \(Unix\) using \`dos2unix\` or \`sed -i 's/\\r$//' entrypoint.sh\`, or configure Git to not convert line endings.
Journey Context:
A developer working on Windows builds a Docker image and pushes it to a Linux server. The container immediately exits with \`exec format error\`. They assume they built for the wrong CPU architecture \(e.g., ARM vs AMD64\) and spend hours trying to force \`--platform linux/amd64\`. The build succeeds, but the error persists. They finally shell into a temporary container and try to run the \`entrypoint.sh\` manually, which reveals a \`/bin/bash^M: bad interpreter\` error. Because they cloned the repo on Windows, Git converted the line endings to CRLF. The Linux kernel sees \`^M\` \(carriage return\) as part of the shebang interpreter path, which doesn't exist. They add a \`RUN sed -i 's/\\r$//' entrypoint.sh\` step or fix their \`.gitattributes\` to prevent CRLF.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:37:24.139893+00:00— report_created — created