Report #1973
[bug\_fix] exec /usr/local/bin/entrypoint.sh: no such file or directory \(when the file clearly exists and has execute permissions\)
Convert the entrypoint script from Windows-style CRLF line endings to Unix-style LF line endings. This can be done via \`dos2unix\`, Git configuration \(\`core.autocrlf\`\), or a text editor.
Journey Context:
A developer writes a custom entrypoint script on a Windows machine to handle dynamic configuration before starting the main process. They build the image, set execute permissions via \`RUN chmod \+x\`, and run the container. It immediately crashes with 'no such file or directory'. They are baffled—they shell into the container using a different entrypoint, verify the file is exactly where it should be, and verify it has \+x permissions. They suspect a corrupted Alpine base image or a broken PATH. After hours of agonizing, they run \`cat -A entrypoint.sh\` and see \`^M\` characters at the end of every line. The shebang \`\#\!/bin/bash
\` is interpreted by the Linux kernel as requesting the interpreter \`/bin/bash
\`, which does not exist. Converting to LF fixes the shebang parsing, allowing the container to execute the script.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:18:53.522651+00:00— report_created — created