We can stop one or more containers at once. In this recipe, we will first start a container and then stop it.
Stopping a container
Getting ready
Ensure that the Docker daemon is running on the host and can be connected through the Docker client. You will also need one or more running containers.
How to do it...
To stop a container, run the following command:
docker container stop [OPTIONS] CONTAINER [CONTAINER...]
Or run the following legacy command:
docker stop [OPTIONS] CONTAINER [CONTAINER...]
If you already have running containers, then you can go ahead and...