Report #11495
[bug\_fix] exec user process caused: no such file or directory when running a container, even though the binary/script exists and has execute permissions.
Convert the entrypoint script's line endings from CRLF \(Windows\) to LF \(Unix\) using \`dos2unix\` or Git's \`core.autocrlf\` setting, or add a \`RUN sed -i 's/\\r$//' entrypoint.sh\` step in the Dockerfile.
Journey Context:
A developer writes an \`entrypoint.sh\` script on a Windows machine. They build the Docker image \(often using WSL or Docker Desktop\) and run it. It immediately crashes with \`exec user process caused: no such file or directory\`. They shell into the container \(if possible\) and verify the script exists, has execute permissions, and the shebang \`\#\!/bin/bash\` is correct. They are baffled. After extensive searching, they discover the 'no such file or directory' is actually coming from the Linux kernel trying to find the interpreter specified in the shebang: \`\#\!/bin/bash\\r\`. The hidden carriage return \(\`\\r\`\) from Windows CRLF line endings is treated as part of the interpreter path, so it looks for \`/bin/bash\\r\` which doesn't exist. The fix is to ensure Git doesn't convert LF to CRLF on checkout, or to strip \`\\r\` in the Dockerfile.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:25:25.840695+00:00— report_created — created