Report #38360
[bug\_fix] Container exits immediately after entrypoint script runs, ignoring CMD
Add exec "$@" at the end of the entrypoint script to execute the CMD or runtime arguments passed to the container.
Journey Context:
A developer writes an entrypoint.sh script to perform runtime configuration, like waiting for a database and setting environment variables. They set ENTRYPOINT \["/entrypoint.sh"\] and CMD \["node", "app.js"\]. When they run the container, it performs the setup but exits with code 0, never starting the Node app. They spend hours debugging the Node app, thinking it's crashing. Finally, they realize the entrypoint script finishes executing and exits, which stops the container. Because the script didn't pass control to the CMD, the Node app never ran. Adding exec "$@" at the end of entrypoint.sh replaces the shell process with the CMD process, keeping the container alive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:51:55.800676+00:00— report_created — created