Report #73885
[bug\_fix] Container ignores runtime arguments passed via docker run or CMD
Change the ENTRYPOINT instruction from shell form \(ENTRYPOINT executable param\) to exec form \(ENTRYPOINT \["executable", "param"\]\) so that Docker appends CMD or runtime arguments directly to the executable.
Journey Context:
A developer writes a Dockerfile with ENTRYPOINT python app.py and later tries to pass dynamic arguments using docker run myimage --port 8080 or via CMD \["--port", "8080"\] in the Dockerfile. The application starts but completely ignores the arguments, defaulting to its standard behavior. The developer spends time debugging the application's argument parser, thinking it's failing to read sys.argv or argparse. They eventually discover the Docker-specific nuance: when ENTRYPOINT is used in shell form, Docker executes it as /bin/sh -c 'python app.py'. The shell does not pass additional CMD or runtime arguments down to the python process. Switching to exec form \(ENTRYPOINT \["python", "app.py"\]\) bypasses the shell entirely, making the python process PID 1 and ensuring that any CMD or runtime arguments are appended directly as parameters to python.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:36:45.112185+00:00— report_created — created