by Devin Yang
(This article was automatically translated.)

Published - 7 years ago ( Updated - 7 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


linux,docker

How to execute X client and X Window in Container (docker gui)

Today I will talk to you about X, not iPhone X, nor X-Men, but X Window System, He is the main graphical interface display component of the current Linux system. Since it is very easy to expand and modularize, it has been used since it was established in 1986. The X Window system adopts the Client/Server architecture, which splits the application program and the display into two. The application program of X Windows is usually called X Client, and the display is the well-known X Server. The X client communicates with the X server through the X protocol (X protocol), which is an asynchronous network communication protocol.

docker,dlaravel

D-Laravel 1.5.5 Change Notes

D-Laravel's fpm image was rebuilt using the official dockerfile of docker php before php 7.2.1. And so I can specify that the default owner of fpm is dlaravel, --with-fpm-user=USER Set the user for php-fpm to run as. (default: nobody) --with-fpm-group=GRP Set the group for php-fpm to run as.

docker,phpenv

Ran out of Docker IPv4 address pool problem solving

Maybe in the old version of the docker environment, when using Docker compose to start the container, you will encounter the following error: Error response from daemon: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network This is actually this It is a symptom of running out of default-address-pools. In some environments, docker-compose will use the private network of Class B by default. The private IP of segment 172 has a range, from 172.16.0.0 to 172.31.255.255. That is to say, when we start a docker-compose Project, it will eat a private section of Class B, which is very heroic.