[Docker] Prune Old Unused Docker Containers and Images

In this lesson, we will look at docker container prune to remove old docker containers. We can also use docker system prune to clean up any containers, images, volumes, and networks all in one command.

This will remove all containers that are not currently running. 

docker container prune

The same as images:

docker image prune

You can also use:

docker system prune

to clean volumes, images, and containers.

Use docker system prune -a to remove not only all dangled images, but all unused images as well.

docker system prune -a
原文地址:https://www.cnblogs.com/Answer1215/p/6764387.html