Since I usually use the docker build command to generate an image, sometimes due to frequent code updates, a lot of none images will be generated. Recently, I want to clear them out. So I wrote the following script: docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker stop docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker rm docker images|grep none|awk '{print $3 }'|xargs docker rmi Supplement: Docker deletes all none images or stopped containers After repeated builds in docker, many none images will remain. The following command deletes all none images in one click. docker rmi `docker images | grep '<none>' | awk '{print $3}'` A simpler way docker rmi `docker images -q -f dangling=true` or docker rmi $(docker images -q -f dangling=true) Remove all stopped containers docker rm $(docker ps -a -q) The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me. You may also be interested in:
|
<<: Abbreviation of HTML DOCTYPE
>>: js array fill() filling method
Mirroring is also one of the core components of D...
Preface Generator functions have been in JavaScri...
1. Install the cross-system file transfer tool un...
Regarding the nginx panic problem, we first need ...
The props of the component (props is an object) F...
View system help help contents mysql> help con...
The image tag is used to display an image in a we...
Physically speaking, an InnoDB table consists of ...
Table of contents 1. rsync, cp copy files 2. sele...
In HTML, you need to specify the encoding used by...
background A few days ago, when I was doing pagin...
Table of contents one. environment two. Precautio...
Servermanager startup connection database error R...
Now, let me ask you a question. What happens when...
This article will use Docker containers (orchestr...