Report #25383
[bug\_fix] exec user process caused: exec format error
Convert the entrypoint script line endings from CRLF \(Windows\) to LF \(Unix\) by configuring Git, using \`dos2unix\`, or adding \`RUN sed -i 's/\\r$//' entrypoint.sh\` in the Dockerfile.
Journey Context:
A developer writes an \`entrypoint.sh\` script on a Windows machine, copies it into the Docker image, and sets \`ENTRYPOINT \["./entrypoint.sh"\]\`. The container starts and immediately crashes with 'exec format error'. They check the architecture \(AMD64\), verify the binary exists, and check the shebang \`\#\!/bin/bash\`. Everything looks correct. They try running \`docker exec -it ... /bin/bash\` but the container exits too fast. Finally, they inspect the file inside the container using \`cat -A entrypoint.sh\` and see \`^M\` \(carriage return\) characters at the end of every line. The Linux kernel tries to execute \`/bin/bash\\r\` as the interpreter, which doesn't exist. Converting the file to LF line endings fixes the shebang parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T21:00:41.968483+00:00— report_created — created