Bug 1374514 - [RFE] Docker should provide a way to look at storage layout/usage
Summary: [RFE] Docker should provide a way to look at storage layout/usage
Keywords:
Status: CLOSED DUPLICATE of bug 1328566
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Vivek Goyal
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913
TreeView+ depends on / blocked
 
Reported: 2016-09-08 21:52 UTC by Eric Jones
Modified: 2019-12-16 06:41 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-14 23:28:43 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Eric Jones 2016-09-08 21:52:34 UTC
- 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.

Comment 3 Daniel Walsh 2016-09-09 11:27:01 UTC
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.

Comment 4 Vivek Goyal 2016-09-09 12:51:18 UTC
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.

Comment 5 Daniel Walsh 2016-09-09 13:08:43 UTC
There could also be huge logs in /var/lib/docker, if you have not changed the default logger to journald.

Comment 6 Vivek Goyal 2016-09-09 13:18:30 UTC
Sure, but container removal should remove those logfile as well?

Comment 7 Daniel Walsh 2016-09-09 13:19:35 UTC
sadly yes.

The difficult part is there is no tool currently that can look at how much space each container is using.

Comment 8 smahajan@redhat.com 2016-09-09 15:56:18 UTC
you might want to look at this proposal being discussed upstream.
https://github.com/docker/docker/issues/22871

Shishir

Comment 9 Vivek Goyal 2016-10-04 12:45:20 UTC
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

Comment 10 Eric Jones 2016-10-04 20:57:46 UTC
Definitely looks like the sort of thing I was looking for!

Thanks!

Comment 11 Daniel Walsh 2016-10-18 13:49:23 UTC
Fixed in docker-1.13

Comment 18 Derrick Ornelas 2017-11-14 23:28:43 UTC
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 ***


Note You need to log in before you can comment on or make changes to this bug.