March 2017
Beginner to intermediate
925 pages
18h 11m
English
We can stop one or more containers at once. In this recipe, we will first start a container and then stop it.
Make sure the Docker daemon is running on the host and you can connect through the Docker client. You will also need one or more running containers.
docker stop [-t|--time[=10]] CONTAINER [CONTAINER...]
$ ID='docker run -d -i fedora /bin/bash' $ docker stop $ID
This will save the state of the container and stop it. It can be started again, if needed.
Read now
Unlock full access