Report #16926
[bug\_fix] CMD arguments or docker run arguments are ignored; the container always runs with default hardcoded arguments or exits unexpectedly
Ensure the ENTRYPOINT script ends with exec "$@" to execute the CMD or runtime arguments passed to the container.
Journey Context:
A developer writes an entrypoint.sh that does environment setup \(e.g., waiting for a DB, generating configs\) and ends with exec /app/binary --port 8080. They define CMD \["--port", "9090"\] in the Dockerfile. When they run docker run myimage --port 9090, it always starts on 8080. They debug by printing arguments in the script and realize $1 is --port but it is never passed to the binary. The fix is to replace the hardcoded binary call with exec "$@", which substitutes the CMD or docker run arguments dynamically. This works because "$@" expands to all arguments passed to the entrypoint script by Docker.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:57:45.892647+00:00— report_created — created