Report #6394
[bug\_fix] Container exits immediately or fails to pass runtime arguments due to ENTRYPOINT and CMD interaction
Use ENTRYPOINT in exec form \(e.g., 'ENTRYPOINT \["python", "app.py"\]'\) if you want to enforce the executable, and CMD for default arguments. If you want the container to be completely overridable, use CMD instead of ENTRYPOINT.
Journey Context:
A developer sets 'ENTRYPOINT python app.py' and 'CMD \["--port", "8080"\]'. When running the container, it crashes because the shell form of ENTRYPOINT ignores CMD. They debug by running 'docker inspect' and seeing the entrypoint is '/bin/sh -c python app.py', which doesn't pass CMD as arguments. Changing to 'ENTRYPOINT \["python", "app.py"\]' allows CMD to be passed as arguments, and 'docker run image --port 9090' correctly overrides the default port.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:53:39.353439+00:00— report_created — created