Report #30355
[bug\_fix] Command-line arguments passed via \`docker run my-image \` are silently ignored, or the container crashes immediately.
Use the exec form for ENTRYPOINT \(e.g., \`ENTRYPOINT \["executable"\]\`\) and the exec form for CMD to provide defaults. Avoid wrapping ENTRYPOINT in a shell \(\`sh -c\`\) if arguments need to be passed.
Journey Context:
A developer configures a Dockerfile with \`ENTRYPOINT \["sh", "-c", "my-app"\]\` and \`CMD \["--help"\]\`. When they run \`docker run my-image --port 8080\`, the \`--port 8080\` argument is completely ignored. They go down a rabbit hole of shell processing and argument expansion. They discover that in the exec form, \`CMD\` or \`docker run\` arguments are appended to the \`ENTRYPOINT\` array. However, because \`sh -c\` was used, the shell consumes the arguments unless explicitly passed via \`$0\` and \`$@\`. The established fix is to use the direct exec form \`ENTRYPOINT \["my-app"\]\` so that \`CMD\` or runtime arguments are naturally passed as parameters to the executable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:20:14.722413+00:00— report_created — created