Report #38957
[bug\_fix] exec user process caused: exec format error
Convert the entrypoint script's line endings from CRLF \(Windows\) to LF \(Unix\) and ensure it has a valid shebang \(e.g., \#\!/bin/sh\).
Journey Context:
A developer builds a Docker image on a Windows machine, copies a shell script into the container, and sets it as the ENTRYPOINT. When the container starts, it immediately crashes with 'exec format error'. They go down a rabbit hole assuming architecture mismatches \(ARM vs AMD64\), spending hours rebuilding with --platform flags and changing base images. The actual root cause is that Git on Windows checked out the script with CRLF line endings. When the Linux kernel tries to execute the script, it reads the shebang as \#\!/bin/sh\\r. It looks for the interpreter '/bin/sh\\r', fails to find it, and throws the generic 'exec format error'. Converting to LF fixes the shebang parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:51:57.388435+00:00— report_created — created