Orphaned Docker mounted host volumes

0 votes

I just inspected my /var/lib/docker/volumes folder and discovered that is bursting with folders named as Docker UUIDs each of which contain a config.json file with contents along the lines of

{"ID":"UUID","Path":"/path/to/mounted/volume","IsBindMount":true,"Writable":true}

where

/path/to/mounted/volume

is the path to the folder on the host that was mounted on to a docker container

A few containers were stopped. So these files I’m seeing in my folder are they the stopped containers or something else?

Jul 31, 2018 in DevOps & Agile by Hannah
• 18,520 points
906 views

1 answer to this question.

0 votes
For Docker 1.9 and up there's a native way:

List all orphaned volumes with

$ docker volume ls -qf dangling=true

Eliminate all of them with

$ docker volume rm $(docker volume ls -qf dangling=true)
answered Jul 31, 2018 by Kalgi
• 52,350 points

Related Questions In DevOps & Agile

0 votes
2 answers
0 votes
1 answer
+1 vote
1 answer

How do I get a Docker container's IP address from the host?

Save your docker image as a tar ...READ MORE

answered Aug 29, 2018 in DevOps & Agile by shubham
• 7,340 points
1,024 views
0 votes
2 answers
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,738 views
+4 votes
2 answers

run docker-daemon with --iptables=false

The docker network model uses iptables to ...READ MORE

answered Aug 2, 2018 in DevOps & Agile by Kalgi
• 52,350 points
10,206 views
+3 votes
2 answers

How do I set max lifetime for Docker Container?

There is one more way which you ...READ MORE

answered Oct 18, 2018 in DevOps & Agile by Kalgi
• 52,350 points
3,641 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP