Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CLI command to view volumes #709

Closed
wants to merge 1 commit into from

Conversation

dnephin
Copy link

@dnephin dnephin commented Dec 6, 2014

Related: #707, #706, #691, #447, #613, #637, #622, #461, #674, #579, #465, ...

Many users have reported issues with volumes, and docker likes to silently ignore volumes when the host path doesn't exist.

To help debug these issues, and to help developers better understand the volumes being used by their containers, this PR adds a new cli command fig volumes.

It will display a table like this, with all the volumes the containers are using:

         Name                 Path         Mode                                             Host                                           
------------------------------------------------------------------------------------------------------------------------------------------
examples_cadvisor_1      /var/lib/docker   rw     /var/lib/docker                                                                          
examples_cadvisor_1      /var/run          rw     /run                                                                                     
examples_cadvisor_1      /sys              ro     /sys                                                                                     
examples_longestname_1   /etc              rw     /var/lib/docker/vfs/dir/531d0515d0fefc1a485e83f933810677d8d6132092387cc1ef8029960585135a

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@bushong1
Copy link

bushong1 commented Dec 7, 2014

+1

@thaJeztah
Copy link
Member

Nice!

On the Docker side, a number of proposals proposals exist as well to make volumes more visible; moby/moby#8484 and moby/moby#8363 and a "POC" implementation by the author of those proposals that allows listing, inspecting, exporting/importing volumes (also orphaned volumes that are no longer used by containers); https://github.com/cpuguy83/docker-volumes.

@bfirsh
Copy link

bfirsh commented Dec 8, 2014

Awesome!

@dnephin Do you think the stuff that's being built into Docker covers the use case here? It looks like this is pretty container-centric rather than service-centric.

@dnephin
Copy link
Author

dnephin commented Dec 8, 2014

I think when it's available it will partially cover this case. I believe the table from the proposal looks similar to the one this command prints.

We'll probably still want a fig command to be able to see volumes for containers created from a fig.yml, so I would expect the implementation of this to change if there are are new API calls that can provide this data, but I wouldn't expect the command to be deprecated entirely. From the PoC it seems to be mostly clientside.

I was hoping to get this in earlier to help debugging of volume-related issues. Maybe even just as an "experimental" feature, so that we don't have to make any guarantees of backwards compatibility.

@thaJeztah
Copy link
Member

I was hoping to get this in earlier to help debugging of volume-related issues.

Agreed. The reason for me to add those proposals here is "for reference" so that your implementation wouldn't diverge too much from the proposal upstream. iirc, upstream also uses docker volumes ls to list volumes.

@dnephin
Copy link
Author

dnephin commented Dec 8, 2014

I could definitely see adding a ls to this fig volumes ls just to make it more forward-compatible with the proposals.

@dnephin dnephin closed this Aug 24, 2015
@dnephin dnephin deleted the fig_cli_volumes branch August 24, 2015 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants