Report #71198
[bug\_fix] Container exits immediately or ignores runtime arguments passed via \`docker run \`.
Change ENTRYPOINT from shell form \(\`ENTRYPOINT node server.js\`\) to exec form \(\`ENTRYPOINT \["node", "server.js"\]\`\), and use CMD for default arguments.
Journey Context:
A developer configures a Dockerfile with \`ENTRYPOINT node server.js\` and tries to pass environment-specific arguments like \`docker run myimage --port 8080\`. The container starts but ignores the --port flag entirely, defaulting to 3000. They debug by printing process arguments inside the app, seeing only \`node server.js\`. They then try \`docker run myimage /bin/sh\` to shell into the container, but it just starts the Node app again. They realize that shell-form ENTRYPOINT runs as a child of \`/bin/sh -c\`, and Docker appends runtime arguments to the shell command, which are completely ignored by the shell executing the string. The fix works because exec-form \`ENTRYPOINT \["node", "server.js"\]\` runs the binary directly, allowing Docker to properly append CMD or runtime arguments as parameters to the node process.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:05:14.104166+00:00— report_created — created