I have few issues with storage spaces. I deleted few big files such as log files (after find unix of big files).
The problem is that delete manually some file of Docker (in /var/lib/docker/...). After deletion of Docker files, I can see that the space left does not change. Docker does not release space.
I restart the service Docker and I the problem persit.
How can I force Docker to release space from (devicemapper, volume, images, ...) ?
With recent versions of Docker you can see the space used with:
docker system df
and prune it with:
docker system prune
The above command combines the prune command that exists for volumes, containers, networks and images:
docker volume prune
docker container prune
docker image prune
docker network prune
All of these have a
--help option
.-o-
On older versions of Docker I ran the script:
This depends on what version of docker you are using, If you are using >1.13 then you can use:
and
^^These will show where disk space is being utilized.
You can cleanup using
prune
commands:^^ This prunes everything & is the most destructive. Or you can use
docker image prune
ordocker volume prune
etc.Docker cleanup job is rather non-existing and you are basically in charge of doing it yourself. There are ways of doing that as pointed out in this blog-post, yet I rather use third-party scripts, e.g.: docker-clean to clean up some of the mess docker leaves behind.