Report #5839
[bug\_fix] Runtime arguments passed via \`docker run\` or \`CMD\` are ignored or silently dropped by the \`ENTRYPOINT\` script.
Append \`exec "$@"\` to the end of the entrypoint shell script to ensure any arguments passed to the script are forwarded to the executed command.
Journey Context:
A developer writes an entrypoint script \(\`entrypoint.sh\`\) to configure dynamic environment variables and start a Java application. They define \`ENTRYPOINT \["/entrypoint.sh"\]\` and \`CMD \["java", "-jar", "app.jar"\]\`. When they run \`docker run myimage java -jar other.jar\`, the container starts but runs the original \`app.jar\` instead of \`other.jar\`. They debug by echoing \`$0\` and \`$@\` in the script. They realize the script ends with \`exec java -jar app.jar\`, completely ignoring the arguments passed from CMD or \`docker run\`. By replacing the hardcoded command at the end of the script with \`exec "$@"\`, the script properly delegates to whatever arguments are provided, restoring the expected Docker ENTRYPOINT/CMD interaction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:21:36.249862+00:00— report_created — created