Report #10529
[bug\_fix] exec format error or /usr/bin/env: 'python\\r': No such file or directory when running container
Convert the entrypoint/script file from Windows-style line endings \(CRLF\) to Unix-style \(LF\). Ensure the script uses the exec form in the Dockerfile \(e.g., \`ENTRYPOINT \["./entrypoint.sh"\]\`\) and has execute permissions.
Journey Context:
A developer builds an image locally on Windows or macOS and it works fine. Pushed to CI \(Linux\), the container instantly crashes with an 'exec format error' or a bizarre '\\r' not found error. They spend hours checking the base image architecture \(amd64 vs arm64\), verifying the shebang line, and checking file permissions. The rabbit hole ends when they realize Git on Windows checks out files with CRLF line endings. The shebang \`\#\!/bin/bash\\r\` is passed to the kernel, which tries to find \`/bin/bash\\r\` and fails. The fix is to configure Git to use LF, or add a \`RUN sed -i 's/\\r$//' entrypoint.sh\` step, or use \`dos2unix\` in the Dockerfile.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:54:07.744026+00:00— report_created — created