Report #3872
[bug\_fix] Container ignores runtime arguments passed via docker run or Compose command
Use the exec form for ENTRYPOINT \(e.g., ENTRYPOINT \["python", "main.py"\]\) instead of the shell form.
Journey Context:
Developer defines ENTRYPOINT python main.py in their Dockerfile. In docker-compose.yml, they add command: --debug expecting main.py to receive the flag. The container starts but ignores --debug and runs normally. They spend hours debugging the Python argument parser, thinking argparse is broken. The root cause is that ENTRYPOINT in shell form is executed as /bin/sh -c "python main.py". The shell command does not pass extra arguments down to the child process. The fix works because exec form runs Python directly as PID 1, and Docker appends CMD or runtime arguments directly to the executable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:22:05.999147+00:00— report_created — created