Report #47473
[bug\_fix] standard\_init\_linux.go:228: exec user process caused: no such file or directory
Convert the entrypoint script's line endings from CRLF to LF using \`dos2unix\` or \`sed -i 's/\\r$//' entrypoint.sh\`, and configure \`.gitattributes\` with \`\*.sh text eol=lf\` to prevent future issues.
Journey Context:
A developer writes an entrypoint script on a Windows machine and builds a Docker image. The build succeeds, but \`docker run\` immediately exits with the cryptic 'no such file or directory' error. They spend hours verifying that \`/bin/sh\` or \`/bin/bash\` exists in the base image and that the script file is successfully copied and has execute permissions. They bypass the entrypoint using \`docker run --entrypoint sh myimage\` and manually inspect the filesystem, finding the script exactly where it should be. Attempting to execute it manually inside the container yields the same error. The root cause is that Windows uses CRLF line endings, appending a hidden \`\\r\` to the shebang line \(\`\#\!/bin/bash\\r\`\). The Linux kernel tries to find an interpreter at \`/bin/bash\\r\`, which does not exist. Converting the file to LF resolves the hidden carriage return issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:09:45.104338+00:00— report_created — created