Report #51092
[bug\_fix] Container takes 10\+ seconds to stop on \`docker stop\`, eventually exiting with code 137 \(SIGKILL\), failing to gracefully shut down.
Change ENTRYPOINT or CMD from shell form \(\`ENTRYPOINT java -jar app.jar\`\) to exec form \(\`ENTRYPOINT \["java", "-jar", "app.jar"\]\`\).
Journey Context:
A developer deploys a Java/Node app to Kubernetes. On pod termination, the app doesn't finish processing in-flight requests and gets force-killed. They add signal handlers to the application code, but nothing changes. They increase the terminationGracePeriodSeconds, which just makes deployments slower. Digging into process trees inside the container \(\`ps aux\`\), they notice their app is running as PID 7, while /bin/sh is PID 1. Docker sends SIGTERM to PID 1 on \`docker stop\`, but /bin/sh \(spawned by the shell form of ENTRYPOINT\) doesn't forward signals to child processes. Changing to the exec form \(JSON array syntax\) replaces /bin/sh with the application itself as PID 1, allowing it to receive and handle SIGTERM directly for a graceful shutdown.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:14:49.925219+00:00— report_created — created