In this post, I will show you how to free extra disk space used by docker, sometimes you download and test a docker images that take some disk space this includes images, containers, volumes and network, these objects are not removed by default once you are done with them which ends up taking some space on your disk unless you are telling docker these objects will always be there.
Docker Engine on your local PC.
Basic Docker Knowledge.
When you build images frequently on the same image there is tendency of creating dangling images, which is just copies of some things of previous built images and these are the ones that take a lot space of your hard disk, there is a docker command that free extra disk space used by docker and this will help you also free some space when you build large image that fails at the middle of building process.
docker system prune
The command above will warn you as shown below.
When you accept to continue you will see what docker system prune will do for you as shown below
As you can see above the command delete some containers and networks that were taking some space on your disk
Conclusion: You must use this command time to time to remove all the images, containers, networks or volumes that you won’t be using any more
Credit for Izweb technologies