Last Updated: October 27, 2018
·
279
· Mayeutik

Delete all the unused data accumulated by Docker easily

If you are a docker user (may it be in production or on your development machine), you may have accumulated quite a bit of useless data by now. There are some existing tools to clean your daemon of unused images and containers (like docker-gc), but since the docker API 1.25 there is an easy to use prune command that could be good enough for you.

The gist is:

sudo docker system prune --all --filter until=$(date -d "1 month ago" +%s)

This will clean all resource not used during the last month! You can find more details in my original blog post on this subject.

Happy cleaning ♻️