(Post created on Oct 05 '16)
I noticed that every time I run an image and delete it, my system doesn't return to the original amount of available space.
The lifecycle I'm applying to my containers is:
> docker build ... > docker run CONTAINER_TAG > docker stop CONTAINER_TAG > rm docker CONTAINER_ID > rmi docker image_id
[ running on a default mac terminal ]
The containers in fact were created from custom images, running from node and a standard redis. My OS is OSX 10.11.6.
At the end of the day I see I keep losing Mbs. How can I face this problem?
EDITED POST
2020 and the problem persists, leaving this update for the community:
Today running:
The easiest way to workaround the problem is to prune the system with the Docker utilties.
docker system prune -a --volumes
Docker takes a conservative approach to cleaning up unused objects (often referred to as “garbage collection”), such as images, containers, volumes, and networks: these objects are generally not removed unless you explicitly ask Docker to do so. This can cause Docker to use extra disk space.
Show activity on this post. I have Docker installed on my Mac OS Catalina and recently found very big file Docker. raw. It is 64 Gb.
Windows: C:\ProgramData\DockerDesktop. MacOS: ~/Library/Containers/com. docker.
WARNING:
By default, volumes are not removed to prevent important data from being deleted if there is currently no container using the volume. Use the
--volumes
flag when running the command to prune volumes as well:
Docker now has a single command to do that:
docker system prune -a --volumes
See the Docker system prune
docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With