Report #101008
[bug\_fix] Shell-form ENTRYPOINT ignores runtime arguments and \`docker stop\` hangs before SIGKILL / exit 137
Use exec-form ENTRYPOINT \(\`ENTRYPOINT \["node", "server.js"\]\`\) so the binary runs as PID 1 and receives Unix signals; combine with exec-form CMD for default arguments; if a shell wrapper is unavoidable, end the script with \`exec "$@"\` or run the container with \`--init\`.
Journey Context:
A Dockerfile ends with \`ENTRYPOINT node server.js\`. Running \`docker run myapp --help\` starts the server with no help output, and \`docker stop\` always takes 10 seconds then reports exit code 137. Inspecting with \`docker exec\` shows \`/bin/sh -c "node server.js"\` as PID 1 and the real node process as a child. The shell does not forward SIGTERM and swallows command-line arguments. Switching to \`ENTRYPOINT \["node", "server.js"\]\` and \`CMD \["--port", "8080"\]\` makes \`docker run myapp --help\` pass \`--help\` to node and \`docker stop\` terminate gracefully in under a second. The root cause is that shell-form ENTRYPOINT wraps the executable in \`/bin/sh -c\`, breaking signal forwarding and argument passing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:49:41.917165+00:00— report_created — created