Report #922
[bug\_fix] Containers with shell-form ENTRYPOINT or CMD ignore \`docker stop\` signals, take the full grace period to terminate, and do not forward CLI arguments.
Use the exec form JSON array syntax, e.g. \`ENTRYPOINT \["/usr/sbin/apache2ctl", "-D", "FOREGROUND"\]\`. If a shell script wrapper is required, end it with \`exec "$@"\` so the real process replaces the shell and becomes PID 1.
Journey Context:
You build an image with \`ENTRYPOINT python app.py\` and deploy it. When you run \`docker stop\`, the container always waits the full grace period and is killed with SIGKILL, and logs show no graceful shutdown. Inside the container you see \`/bin/sh -c python app.py\` as PID 1 and \`python app.py\` as a child. The shell swallows SIGTERM and does not forward it. Changing to \`ENTRYPOINT \["python", "app.py"\]\` makes python PID 1; it receives SIGTERM directly and the container stops in milliseconds. The same fix applies to startup scripts: use \`exec\` so the script's process is replaced by the real server.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T14:58:30.377192+00:00— report_created — created