DEV Community

Cover image for Free up disk space by running these docker commands
Hossein Kazemi
Hossein Kazemi

Posted on

Free up disk space by running these docker commands

If you are using Docker, every now and then your disk gets filled up with dangling docker images and volumes. Simple run the following commands to get rid of them and open up disk space on your machine:

# remove dangling images
docker rmi -f $(docker images -f dangling=true -q)

# remove dangling volumes
docker volume rm $(docker volume ls -qf dangling=true)
Enter fullscreen mode Exit fullscreen mode

I am starting a newsletter focused on teaching hands-one backend and infrastructure through building micro-projects.
Follow me on Twitter for the announcement: hossein761

Top comments (1)

Collapse
 
skenekt profile image
Alexey Suharev

thank. During