This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Sunday, January 14, 2018

Working with Docker Container - Stopping a container

Stopping a container

We can stop one or more containers at once. In this recipe, we will first start a container and then stop it.
Syntax : docker stop [-t|--time[=10]] CONTAINER [CONTAINER...]


root@Docker:~# docker stop fb83a04222c7
fb83a04222c7


This will save the state of the container and stop it. It can be started again, if needed.

To stop a container after waiting for some time, use the --time/-t option.

To stop all the running containers run the following command:

root@Docker:~# docker stop `docker ps -q`
5d950a3835d6
32238eabfac4

For help with the docker stop use --help

No comments:

Post a Comment