Sometimes I tried a bunch of containers or images in my own environment, how to remove all the images and containers in the system?
These instructions are provided for your reference:
Note that you do understand what containers and images are in docker.
Do not execute the following commands at will, on the online host:
stop all containers: stop all containers
docker kill $(docker ps -q)
remove all containers: Remove all containers
docker rm $(docker ps -qa)
remove all docker images: remove all docker images
docker rmi $(docker images -q)
Note: Regarding the difference between docker stop and docker kill, we can view the instructions through the following commands:
docker help stopThe main process inside the container will receive
SIGTERM , and after a grace period, SIGKILL .docker help killThe main process inside the container will be sent
SIGKILL , or any signal specified with option --signal .
No Comment
Post your comment