Docker Takes A Lot of Space. Use Docker Prune To Reclaim It.

Docker images, both big and small, take space on your hard drive.

Constantly creating — or, “building” in the development operations “DevOps” parlance takes even more space. Each “build”, a.k.a. docker build or docker-compose build creates a new or multiple new Docker images. The previously built images don’t necessarily go anywhere, consuming more and more precious hard disk space. While today’s machines are coming with a few Terabytes of storage space, it still adds up. Not to mention it makes the output from the docker images command harder to read. Compare this to this.

There’s this little command that I’m going to tell you about that will let you go from bloat to gloat.

docker system prune

Docker system prune allows you to remove “orphaned” or “dangling” images form old Docker builds your system is no longer using, along some of their associated build artifacts (unused networks, build caches, etc.).

Here’s a good ol’ blog post about prune.

Screenshot:

How much space I saved when s̶w̶i̶t̶c̶h̶i̶n̶g̶ ̶t̶o̶ ̶G̶e̶i̶c̶o̶ using system prune?

You’re welcome!

That’s it! Happy Dockerizing.

Organic, fair-sourced DevOps and Full-Stack things. This is a BYOB Establishment — Bring Your Own hipster Beard.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store