docker tidy unused image and container

If you were using docker for a while, there maybe huge disk waste by docker. because there were so many unused docker images and stopped container.

The powerful command

docker system prune -a -f

You need tidy them to release your disk space. you should clean unused container first, then clean unused images

To clean unused container

docker ps -a | grep \"Exited\" | awk '{print $1}' | xargs docker rm -vf 

to clean unused images

docker images | grep \"^<none\" | awk '{ print $3 }' | xargs docker rmi 

Post: 1555472282

Views: 392

Follow me: @twitter @github
Scan QR code and Donate me via alipay:
donate me via alipay
Donate me Bitcoin:136MYemy5QmmBPLBLr1GHZfkES7CsoG4Qh
Powered by GoSense RSS