Hide Forgot
- What is the nature and description of the request? As an admin I require the ability to investigate where my storage for Docker is being used. - Why does the customer need this? (List the business requirements here) When Docker Storage runs out of space, there needs to be a way to investigate what is specifically using up all the storage so that it can be cleaned up. - How would the customer like to achieve this? (List the functional requirements here) The docker daemon keeps track of the used storage (otherwise it wouldn't be able to know when it is all used) so provide a way to have the docker daemon provide those details. - For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented. Setup Docker storage, use some of it, and use the new option or command to determine how the storage is being used. - Is there already an existing RFE upstream or in Red Hat Bugzilla? Not that I am aware.
The problem here is there are multiple places where docker currently uses storage, especially when using the devicemapper back end. devicemapper storage and storage on /var/lib/docker, and any volumes that are being used inside of a container I think the daemon has an idea of storage for devicemapper, It does not keep track of the others. If we move to OverlayFS the storage becomes more concentrated in /var/lib/docker.
Docker "info" already has lot of information. It provides number of images and containers. To reclaim space, user can delete containers and images which are not in use any more. (Similar to deleting files on filesystem for reclaiming space). This should free up space used by images and container and associated metadata as well. (logs etc). I think only remaining piece will be volume. For that either remove containers along with their volumes (using option -v) or use "docker volume <ls/rm>" commands to list and remove volume to free up more space. If this is not good enough, I think we will require more precise description of requirement.
There could also be huge logs in /var/lib/docker, if you have not changed the default logger to journald.
Sure, but container removal should remove those logfile as well?
sadly yes. The difficult part is there is no tool currently that can look at how much space each container is using.
you might want to look at this proposal being discussed upstream. https://github.com/docker/docker/issues/22871 Shishir
Look at following docker merge which introduce new commands for managing space usage of docker. Is this good? This will show up in docker-1.13 though. https://github.com/docker/docker/pull/26108
Definitely looks like the sort of thing I was looking for! Thanks!
Fixed in docker-1.13
Closing as this is resolved in docker-latest 1.13.1 with new 'docker system df' command. *** This bug has been marked as a duplicate of bug 1328566 ***