Report #104316
[bug\_fix] container exits immediately after starting due to ENTRYPOINT/CMD format
Use the exec form \(\`\["executable", "param"\]\`\) for both ENTRYPOINT and CMD to ensure proper signal handling and avoid shell interpretation issues. Wrap each argument as a separate string in the JSON array.
Journey Context:
A developer wrote \`ENTRYPOINT \["echo", "$HOME"\]\` expecting the shell variable to expand, but instead the container printed \`$HOME\` literally. They then switched to \`ENTRYPOINT echo $HOME\` \(shell form\), which worked but caused the container to not respond to SIGTERM. The process ran as a child of \`/bin/sh -c\`, and signals were not forwarded. After a crash course on Docker best practices, they learned that the exec form \(\`\["echo", "$HOME"\]\`\) does not expand variables, so they should use \`ENTRYPOINT \["sh", "-c", "echo $HOME"\]\` or set environment variables with \`ENV\`. The root cause is that the shell form wraps the command in \`/bin/sh -c\`, introducing a shell process that does not forward signals.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-02T20:02:38.794643+00:00— report_created — created