Skip to main content

Command Palette

Search for a command to run...

Tip for Recovering Disk Space from Docker Containers

Updated
1 min read
Tip for Recovering Disk Space from Docker Containers

If you use Docker a lot every day, you should clean up unwanted images, volumes, and containers to free up space on your disk.

To remove everything you don't need (make sure to stop unwanted containers first), run this command:

docker system prune --all

This command (note that it may take a while, especially in the last step) helps free up valuable disk space by removing not only the images, volumes, and containers mentioned above but also the build cache for the containers.

Moreover, if you want to just get rid of unwanted images, then run the following command,

docker image prune --all

if you want to just get rid of unwanted volumes, then run the following command,

docker volume prune --all

Moreover, if you want to just get rid of unwanted containers, then run the following command,

docker container prune --all

I reclaimed almost 74 GB of disk space. How much did you reclaim? Let me know in the comments below. hope this article helped you :)