Report #100078
[bug\_fix] Container exits immediately or CLI arguments are ignored because ENTRYPOINT and CMD are combined incorrectly
Use exec-form ENTRYPOINT as the fixed executable and CMD as default arguments: \`ENTRYPOINT \["node", "server.js"\]\` \+ \`CMD \["--port", "3000"\]\`. Override CMD at runtime with \`docker run myimage --port 8080\`; the args replace CMD and append to ENTRYPOINT. Avoid shell-form ENTRYPOINT unless you need shell expansion.
Journey Context:
You set \`ENTRYPOINT node app.js\` and \`CMD \["--help"\]\` expecting \`docker run myimage --port 8080\` to pass --port to node. Instead the container shows the help output or crashes. You read the docs and learn that shell-form ENTRYPOINT runs \`/bin/sh -c 'node app.js'\` which receives the CMD as arguments to sh, not to node. Switching both to exec form makes Docker pass arguments directly: the runtime args replace CMD and become extra positional args to ENTRYPOINT. This is the canonical pattern used by official images.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:36:55.001093+00:00— report_created — created