by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

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 stop
The main process inside the container will receive SIGTERM , and after a grace period, SIGKILL .

docker help kill
The main process inside the container will be sent SIGKILL , or any signal specified with option --signal .

Tags: docker

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


wordpress, d-laravel, docker, docker-compose

How to install Wordpress with D-Laravel

An 8-minute teaching video, introducing the installation of Wordpress on D-Laravel. D-Laravel is a docker-compose Laravel framework development environment, but it does not mean that it cannot be used to install other things. This video introduces the use of D-Laravel to install non-Laravel PHP projects, You can learn the usage of related instructions on D-Laravel: ./create --host usage, docker-compose up -d and ./console mysql usage, The database connection setting method after D-Laravel v1.0.0.

docker,laravel,nfs

Docker's NFS on macOS

D-laravel's nfs mode, in this article you can learn how to use NFS+Docker on macOS.

polymer,docker

D-Laravel supports index.html by default

D-Laravel's nginx environment settings support index.html by default, simply put Now, besides, D-Laravel can be used to run Laravel's Project, and it can also be used to run other Projects. Currently Apple's WebKit is already in preview for Service-Workers....