docker stop

Stop one or more running containers. Sends SIGTERM first, then SIGKILL after timeout.

Syntax

docker stop [OPTIONS] CONTAINER [CONTAINER...]

Examples

Example 1
docker stop my-container

Gracefully stop a single container.

Example 2
docker stop -t 5 my-container

Wait 5 seconds before SIGKILL.

Example 3
docker stop $(docker ps -q)

Stop all running containers.

Common flags

FlagDescription
-t, --timeSeconds to wait before killing (default 10)

Tips & best practices

Related commands

View full Docker cheatsheet →