Report #74293
[bug\_fix] Container exits immediately or arguments passed via docker run are incorrectly appended to the entrypoint
Use ENTRYPOINT for the base executable and CMD for default arguments, or switch entirely to CMD if the command needs to be easily overridden by docker run arguments.
Journey Context:
A developer defines 'ENTRYPOINT \["python", "app.py"\]' and wants to occasionally run the container with a debug flag via 'docker run myimage --debug'. The container crashes, complaining of an unrecognized Python argument. The developer realizes that because ENTRYPOINT is not overridden by docker run arguments, '--debug' was appended to the ENTRYPOINT, executing 'python app.py --debug'. Later, they try to debug by running 'docker run -it myimage bash', but bash is just passed as an argument to app.py. They switch to 'CMD \["python", "app.py"\]' so that 'docker run myimage bash' completely overrides the command, allowing them to inspect the container environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:17:59.916234+00:00— report_created — created