Report #66807
[bug\_fix] docker: Error response from daemon: OCI runtime create failed: container\_linux.go:345: starting container process caused "exec: \\"/bin/bash\\": executable file not found"
Use CMD instead of ENTRYPOINT if the entire command needs to be easily overridden at runtime, or use docker run --entrypoint to override the ENTRYPOINT. Ensure ENTRYPOINT is only used for the executable and CMD for default arguments.
Journey Context:
A developer writes a Dockerfile with ENTRYPOINT \["python", "app.py"\]. They build the image and run it with docker run myimage --port 8080, which works perfectly because --port 8080 is passed as an argument to python app.py. Later, they need to debug the container and run docker run -it myimage /bin/bash. The container crashes with a bizarre error claiming /bin/bash cannot be found or executed. The developer is confused, thinking /bin/bash should override the process. The rabbit hole leads them to misunderstand how Docker handles overrides: positional arguments in docker run append to ENTRYPOINT, they don't replace it. They only replace CMD. The fix is to either change the Dockerfile to use CMD \["python", "app.py"\] so docker run myimage /bin/bash works as expected, or use docker run --entrypoint /bin/bash -it myimage to explicitly override the entrypoint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:36:53.078517+00:00— report_created — created