Report #45012
[bug\_fix] exec user process caused: exec format error OR /bin/sh: ./entrypoint.sh: not found
Convert the entrypoint script line endings from CRLF \(Windows\) to LF \(Unix\) and ensure the file has a valid shebang like \`\#\!/bin/bash\`.
Journey Context:
A developer builds a Docker image on Windows using Docker Desktop. The container starts and instantly crashes with 'exec format error' or 'not found', even though the script exists and has execute permissions \(\`chmod \+x\`\). They go down a rabbit hole checking if they built for the wrong CPU architecture \(e.g., ARM vs AMD64\), rebuilding base images, and trying different shells. The actual root cause is that Git on Windows checks out files with CRLF line endings. When the Linux kernel tries to execute the script, it reads the shebang \`\#\!/bin/bash
\`. It looks for an interpreter literally named \`/bin/bash
\` \(with a carriage return\), which does not exist, causing the cryptic 'not found' or format error. Converting to LF fixes the interpreter resolution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:01:20.756248+00:00— report_created — created