[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

 

posted @ 2017-04-25 21:15  Zhentiw  阅读(319)  评论(0编辑  收藏  举报