Report #55141
[bug\_fix] Container exits immediately with code 0 when running \`docker run myimage\`, ignoring CMD or runtime arguments.
Add \`exec "$@"\` to the end of the entrypoint shell script so it executes the CMD or arguments passed to \`docker run\`.
Journey Context:
A developer writes an entrypoint script \(\`entrypoint.sh\`\) to perform runtime configuration like setting environment variables or waiting for a database. They define \`ENTRYPOINT \["/entrypoint.sh"\]\` and \`CMD \["python", "app.py"\]\`. The container starts, the script runs, but the Python application never starts, and the container exits cleanly. The developer discovers that the entrypoint script executed successfully and then terminated, causing the container to stop. Because the script didn't explicitly execute the command passed to it \(the CMD\), it was ignored. Adding \`exec "$@"\` at the end of the script passes control to the CMD, replacing the shell process with the application process, ensuring signal handling works correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:02:54.359087+00:00— report_created — created