Report #15594
[bug\_fix] exec user process caused: no such file or directory \(or CMD ignored when overriding ENTRYPOINT\)
Ensure the ENTRYPOINT script uses exec "$@" to pass control to the CMD arguments, or restructure ENTRYPOINT to be the executable and CMD to be the default arguments.
Journey Context:
A developer writes an entrypoint.sh script to perform runtime configuration \(like replacing environment variables in a config file\), and ends it with the specific command to start the app. Later, they want to run a one-off command like docker run myimage bash, but the container ignores 'bash' and starts the app anyway. They try to fix this by moving the app start command to CMD, but the entrypoint script finishes and the container exits with 'no such file or directory' because the script doesn't execute the CMD. The rabbit hole involves understanding Docker's strict separation: ENTRYPOINT runs the script, but if the script doesn't explicitly execute the arguments passed to it \(which become CMD\), the container just exits. Adding exec "$@" at the end of the entrypoint.sh script bridges the gap, executing whatever CMD was provided.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:28:19.755425+00:00— report_created — created