Current location - Health Preservation Learning Network - Slimming men and women - Docker (5)- garbage removal
Docker (5)- garbage removal
Docker will produce some garbage, which is 1. Mirror garbage, container garbage, other cache garbage, data volume garbage and build cache garbage.

Clear docker mirror cache

Why do you want a command to open a blog record?

Because of the terrible pit, I had problems with the mirror all morning, and finally got the cached pot.

Buddha!

order

Docker System Cleanup-Volume

1

This command clears:

All stopped containers

All networks not used by any container

All volume that are not used by any contain.

There are no all mirrors of the instance.

You can get a list of all active and inactive containers by passing the -a option to the docker container ls command:

Terminal container ls -a

Once you know the container ID of the container to be deleted, please pass it to the docker container rm command. For example, to delete the first two containers listed in the output above, run:

Terminal container RM cc 3f2ff51cab CD 20b396a061

RM cc 3f 2ff 5 1 cab CD 20b 396 a 06 1

Stop container

Container terminal cc3f2ff5 1cab

Delete all stopped containers.

Dock container pruning

View a mirror image of docker

Docker image ls

Delete docker mirror

Note: To delete an image, you must first delete the corresponding container.

Docker image RM 75835a67d1342a4cca5ac898

The file number is RMI 75835a67d1342a4cca5ac898.

In fact, when the same image has multiple tags, executing the docker rmi command will only delete the tags specified in the many tags of the image, and will not affect the original image file. If an image does not have multiple tags, the image will be completely deleted if and only if there is only one tag.

After using Docker for a period of time, there are usually some temporary and unused image files left in the system, which can be cleaned by the following commands:

Docker image trimming -a

View docker volume

Docker volume ls

Delete docker volume

Label volume rm 4e 12af89 13af

Delete all unused volumes.

Docker volume cleaning

Docker system is a command to manage disk space. Docker system df, similar to df command, is specially used to check the disk usage of docker.