Skip to content

Signals and PID 1: why docker stop takes 10 seconds

Select an icon to see what it is.

Step 1 of 6

docker stop sends SIGTERM to PID 1

The CLI sends POST /containers/{id}/stop. dockerd sends the container's stop signal, SIGTERM unless the image sets another, to the main process, which is PID 1 inside the container. It starts a 10 second timer.

$ docker stop web
PrevNext

POST /v1.45/containers/c2d3e4f5a6b70819c2d3e4f5a6b70819c2d3e4f5a6b70819c2d3e4f5a6b70819/stop

t: seconds to wait before SIGKILL (10 by default)