Report #12610
[bug\_fix] Container exits immediately or runs without expected CMD arguments when overriding via docker run
Use the exec form \(JSON array\) for both ENTRYPOINT and CMD \(e.g., \`ENTRYPOINT \["node"\]\` and \`CMD \["app.js"\]\`\). Do not mix shell form and exec form, as shell form \`ENTRYPOINT\` ignores \`CMD\` entirely.
Journey Context:
A developer defines \`ENTRYPOINT node\` in their Dockerfile and wants to pass dynamic arguments via \`CMD\` or \`docker run\`. When they run the container, it either starts \`node\` without the expected arguments, or throws an 'executable not found' error if they tried to pass arguments via \`docker run\`. They spend hours debugging environment variables, PATH configurations, and file permissions. The root cause is that the shell form of \`ENTRYPOINT\` invokes \`/bin/sh -c\`, which fundamentally does not pass \`CMD\` or \`docker run\` arguments to the command. Switching both to the exec form \(JSON arrays\) bypasses the shell, allowing \`CMD\` to be correctly appended as arguments to the \`ENTRYPOINT\` binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:25:44.178807+00:00— report_created — created