Report #17676
[bug\_fix] Running 'docker run myimage echo hello' prints nothing or throws 'executable file not found in $PATH', instead of overriding the default command.
Rewrite ENTRYPOINT in the exec form \(e.g., ENTRYPOINT \["/app/start.sh"\]\) and use CMD to provide default arguments \(e.g., CMD \["--help"\]\). Do not use the shell form for ENTRYPOINT if you intend to pass arguments from the docker run command.
Journey Context:
A developer writes a Dockerfile with 'ENTRYPOINT /app/start.sh' and 'CMD \["--default-arg"\]'. When they run 'docker run myimage --custom-arg', the custom argument is completely ignored. When they run 'docker run myimage echo hello', it throws an error. They dig into bash scripting and argument passing. The root cause is that the shell form of ENTRYPOINT \('ENTRYPOINT /app/start.sh'\) runs the command via '/bin/sh -c', which completely ignores CMD and any arguments passed via 'docker run'. The shell form does not pass through command line parameters. By switching ENTRYPOINT to the exec form \('ENTRYPOINT \["/app/start.sh"\]'\), Docker executes the script directly, and CMD or 'docker run' arguments are correctly appended as parameters to the entrypoint script, allowing standard argument override behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:57:54.338252+00:00— report_created — created