Report #962
[bug\_fix] Container does not stop gracefully because ENTRYPOINT uses shell form
Convert ENTRYPOINT to JSON/exec form: \`ENTRYPOINT \["/app/server", "--port", "8080"\]\`. If you need shell expansion, use a wrapper script with \`exec "$@"\` and set \`ENTRYPOINT \["/entrypoint.sh"\]\` so PID 1 is the actual application and signals propagate correctly.
Journey Context:
You deploy a container and notice \`docker stop\` always takes 10 seconds and then kills the process. Logs show the app receives SIGKILL instead of SIGTERM. The Dockerfile uses \`ENTRYPOINT /app/server --port 8080\`. You read about Linux PID 1 signal handling and realize shell-form ENTRYPOINT runs the command as a child of \`/bin/sh -c\`, which does not forward SIGTERM to the application by default. You change to exec form so the application becomes PID 1, and \`docker stop\` now completes in milliseconds. For cases needing environment-variable expansion you introduce an entrypoint script that ends with \`exec "$@"\`, preserving PID 1 for the real command. The fix works because only PID 1 receives signals directly, and shell-form ENTRYPOINT leaves a shell as PID 1 that swallows them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T15:53:43.667503+00:00— report_created — created