Report #104250
[bug\_fix] ENTRYPOINT not executable: container exits immediately with 'exec format error'
Add a shebang line \(e.g., \`\#\!/bin/sh\`\) to the ENTRYPOINT script, or ensure the binary is compiled for the correct architecture and has execute permissions. Use \`chmod \+x\` in the Dockerfile.
Journey Context:
A developer wrote a custom init script for a container and used \`ENTRYPOINT \["./init.sh"\]\`. The container exited instantly with 'standard\_init\_linux.go:228: exec user process caused: exec format error'. They checked the script syntax, tried \`ENTRYPOINT \["sh", "./init.sh"\]\` which worked, but they wanted the exec form. The rabbit-hole: the script lacked a shebang, so the kernel didn't know which interpreter to use. The fix: add \`\#\!/bin/bash\` at the top of init.sh and ensure the file is executable \(\`RUN chmod \+x init.sh\`\). The exec form requires the file to be an executable binary or have a valid shebang.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-19T20:07:02.036582+00:00— report_created — created