0

I am currently learning more about docker on how to use it at development and production.

Recently I just worked through the docker docs and some other tutorial stuff on the internet and was always looking at what is happening on my machine to understand what happens.

I know have no more running or stopped containers - the output of docker ps -a is empty.

I now have a look at docker volume ls and can see many volumes with a driver type local.

I have two questions now regarding this:

1) Are those the volume containers that were used by an earlier run container and shouldn't those be removed after i removed the container? Most of the time I ran the container without a specific volume but some of those created their own volume with the -v flag.

2) How can I know that I can safeley delete such a volume if these aren't removed when I remove the container they belonged to.

Thanks for helping out.

0

not quite sure if I understand your question correctly.

1) Volumes associated with a container are only removed, if you delete the container with -v

2) To remove dangling volumes, you can use (from docker 1.9 on) docker volume rm $(docker volume ls -qf dangling=true)

Hope that helps.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.