August 2018
Intermediate to advanced
352 pages
12h 30m
English
To remove a running container, it must be stopped first using the docker container stop command and then removed using the docker container rm command.
To forcefully remove a container without intermediate stop, use the -f option of the docker container rm command.
To remove all the containers, we first need to stop all running containers and then remove them. Be careful before running these commands as they will remove both running and stopped containers:
$ docker container stop $(docker container ls -q)
$ docker container rm $(docker container ls -aq)
There are options to remove a specified link and volumes associated with the container, which we will explore later.
Read now
Unlock full access