Report #99131
[bug\_fix] Container does not stop gracefully; \`docker stop\` takes 10 seconds and falls back to SIGKILL
Use the JSON/exec form for \`ENTRYPOINT\` and \`CMD\`, e.g. \`ENTRYPOINT \["node", "server.js"\]\` and \`CMD \["--port", "8080"\]\`. If you must use a shell script wrapper, end it with \`exec "$@"\` so the real process replaces the shell and becomes PID 1. Shell form wraps the command in \`/bin/sh -c\`, which does not forward SIGTERM.
Journey Context:
A developer writes \`ENTRYPOINT node server.js\` because it looks simpler. Locally, Ctrl\+C in an interactive terminal works, so they think it is fine. In production, Kubernetes or \`docker stop\` sends SIGTERM and the container ignores it, hanging for the full termination grace period before being killed with SIGKILL. Logs show no graceful shutdown. They check \`docker top\` and see \`/bin/sh -c "node server.js"\` is PID 1, not \`node\`. Switching to \`ENTRYPOINT \["node", "server.js"\]\` makes \`node\` PID 1 and signal handling works immediately. They also learn that shell form ignores any \`CMD\` arguments, so \`docker run myimage --flag\` was not being passed through.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:36:59.642192+00:00— report_created — created