Report #81946
[bug\_fix] docker run myimage /bin/bash passes /bin/bash as an argument to the ENTRYPOINT instead of overriding the command
Use CMD instead of ENTRYPOINT if the container is meant to run a default executable that should be easily overridden by docker run arguments. If ENTRYPOINT is required, override it using the --entrypoint flag.
Journey Context:
A developer builds an image with ENTRYPOINT \['python', 'app.py'\]. They want to shell into the container for debugging using 'docker run myimage /bin/bash'. The container crashes with a Python error because '/bin/bash' is passed as an argument to 'python app.py'. They debug by realizing ENTRYPOINT makes the container an executable for that specific binary, and docker run arguments append to it, rather than replacing it. They switch to CMD \['python', 'app.py'\] so that 'docker run myimage /bin/bash' correctly overrides the entire command array, allowing shell access.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:08:19.590675+00:00— report_created — created