Originally published byDev.to
How to free up disk space used by Docker
When you use Docker on a daily basis, your disk can get full of unnamed images, stopped containers, dangling volumes and build cache. Here is how to clean all that up.
First, check how much space Docker is using:
docker system df
This will show you images, containers, volumes and build cache with their sizes.
To remove all stopped containers, dangling images and unused networks in one go:
docker system prune -f
If you also want to remove dangling volumes:
docker system prune -af --volumes
Just be careful with the --volumes flag. Once they are gone, any data stored in anonymous volumes is lost.
Now if you want to remove only what is old:
docker system prune -af --filter "until=24h"
The --filter flag removes everything created or used more than 24 hours ago.
That's all for now.
Thanks for reading!
🇺🇸
More news from United StatesUnited States
NORTH AMERICA
Related News
Secret Claude Tracker Shocks Users After Anthropic's Anti-Surveillance Stance
12h ago
EV Batteries Defy Expectations, Last Hundreds of Thousands of Miles
1d ago
GBase 8a Performance Anomaly Case Study: How a Single Parameter Change Sparked a Chain Reaction
1d ago
Who Else Has Inherited a Codebase With Zero Comments and a Prayer?
1d ago
完美的平庸
4h ago