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
background As the company's sub-projects incr...
MySQL startup error Before installing MySQL on Wi...
After the changes: innodb_buffer_pool_size=576M -...
Design Intentions When developing a page, you oft...
Nginx logs can be used to analyze user address lo...
Using the internal function instr in MySQL can re...
Table of contents LAMP architecture 1.Lamp Introd...
Computed properties Sometimes we put too much log...
Pull the image # docker pull codercom/code-server...
Table of contents 1. Repeated declaration 1.1 var...
tomcat official website tomcat is equivalent to a...
Table of contents Vue CLI builds a Vue project Vu...
Summary: Problem solving records of MYSQL: No mat...
Functions about null in MySql IFNULL ISNULL NULLI...
There are two ways to disable form submission in ...