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

Better management of Volumes #2054

Closed
BigMorty opened this issue Jun 10, 2020 · 3 comments
Closed

Better management of Volumes #2054

BigMorty opened this issue Jun 10, 2020 · 3 comments

Comments

@BigMorty
Copy link
Member

BigMorty commented Jun 10, 2020

[This came from PaulY]
First, the challenge:
I have a lot of volumes. I think most are orphaned junk I should clean up but using our commands or inspect I see no useful information. What I really want to know is which container is using a volume, if any.

The Docker command that solves this is as follows where volume could be the name or the mountpoint inspect tells you:
$ docker ps -a --filter volume=c4be1fa31accf8c43de23adacc2542c7af14ee8e60048cd9fe0b3900eda00261
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
12d0ecc421bb mariadb "docker-entrypoint.s…" 6 weeks ago Up 5 hours (healthy) 0.0.0.0:3306->3306/tcp mariadb

Ah ha, it's mariadb container that is using it -- and I should not delete it.

In the docker explorer, it would be really cool if containers just let you find mounted volumes. And also if volumes could show their dependent containers.

Here is a somewhat related issue from the past - #1209

@dbreshears dbreshears added this to the 1.5.0 milestone Jun 11, 2020
@bwateratmsft
Copy link
Collaborator

Should look to see if there are commands we could use to highlight/select tree nodes.

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Jul 17, 2020

Unfortunately, I don't think this is actionable.

  1. The relationship of container to volume is many-to-many. Consequently, grouping cannot be used, or a node could appear multiple times in a tree view which is problematic for many reasons.
  2. The reveal API can only highlight/select one node, not many, so a command to jump from selecting a volume to selecting its referencing containers isn't possible.
  3. Volume inspect info does not give any information about usage, even though the spec suggests it should.
  4. There is already a Prune command for removing all unused volumes.
  5. The Remote - Containers extension offers the ability to "look into" a volume (Inspect volume in Visual Studio Code).

The best we could possibly do is monkey patch the containers using a volume into the volume's inspect data, but the user experience is mediocre and I'm not sure it justifies the amount of work it would take. Additionally, it may cause user confusion when they see this information in our inspect info but never see it when doing docker inspect themselves.

@bwateratmsft bwateratmsft modified the milestones: 1.5.0, Future Jul 22, 2020
@bwateratmsft
Copy link
Collaborator

Duping this to #2538.

@bwateratmsft bwateratmsft removed this from the Future milestone Dec 3, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants