docker stop

Asks a running container to shut down cleanly, then forces it if it does not.

In more detail

Docker sends SIGTERM, or the image's configured stop signal, to the main process, waits 10 seconds by default, then sends SIGKILL. The container and its data stay, ready to start again, unless it was run with --rm. If stop always takes the full 10 seconds, the process is ignoring the signal, often because it runs as PID 1 through a shell.

Examples

docker stop taskapi-demo
docker stop m07l03-b3

Related terms

Taught in

References