Report #5691
[bug\_fix] exec /usr/local/bin/entrypoint.sh: no such file or directory when starting the container, despite the file existing and having execute permissions.
Convert the entrypoint script line endings from CRLF \(Windows\) to LF \(Unix\) using dos2unix, or add 'RUN sed -i "s/\\r$//" /usr/local/bin/entrypoint.sh' to the Dockerfile.
Journey Context:
A developer builds an image on a Windows machine and copies a shell script to act as the ENTRYPOINT. When running the container on a Linux host, it immediately crashes with 'no such file or directory'. They are baffled—they mount the filesystem and verify the file is definitely there and has 755 permissions. They spend hours checking path resolutions and base image versions. Finally, they inspect the file using a hex editor or 'file' command inside the container and discover Windows-style CRLF \(\\r\\n\) line endings. The shebang line is read as '\#\!/bin/bash\\r', causing the Linux kernel to search for an interpreter literally named '/bin/bash\\r', which doesn't exist. Converting the line endings to LF resolves the invisible crash.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:53:05.421048+00:00— report_created — created