Report #92097
[bug\_fix] $'\\r': command not found or exec user process caused: no such file or directory
Convert the entrypoint script to Unix line endings \(LF\) by running \`sed -i 's/\\r$//' entrypoint.sh\` inside the Dockerfile, or configure Git's \`core.autocrlf\` to prevent CRLF conversion.
Journey Context:
A developer creates an \`entrypoint.sh\` script on a Windows machine to handle runtime configuration before starting the main process. They copy it into the Dockerfile, set \`RUN chmod \+x entrypoint.sh\`, and set \`ENTRYPOINT \["./entrypoint.sh"\]\`. The container starts and immediately exits with a bizarre error like \`/bin/sh: 1: ./entrypoint.sh: not found\` or \`$'\\r': command not found\`. The developer wastes hours checking file permissions, trying different shebangs \(\`\#\!/bin/bash\` vs \`\#\!/bin/sh\`\), and verifying the file actually exists by running \`ls -la\` in a temporary container. The root cause is that Git on Windows converted the line endings to CRLF. Linux expects LF, so the OS interprets the \`\\r\` character as part of the command or shebang, breaking execution. The \`sed\` command strips the carriage return, allowing the shell to parse the script correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:10:41.217077+00:00— report_created — created