Docker mount dangling volume

前端 未结 3 1774
北海茫月
北海茫月 2021-01-03 07:23

I recently created a mongodb docker instance running on boot2docker on windows.

Unfortunately during my experimenting with kitematic I managed to accidentally remove

3条回答
  •  粉色の甜心
    2021-01-03 07:41

    I usually register the path (in a file) of any data volume container I create, precisely in that case. See "Docker volumes for persistent data - is it enough to pass container path only?" and my script updateDataContainerPath.

    What I have seen is that:

    • any new data volume container comes with its own Mounts.Source path,
    • you can delete that new folder (which is empty)
    • you can replace it with the folder of your old data volume container (giving it the same name as the new one, but with the content of the old data volume container)

    That will be enough for the new data volume container to give you access to your old data.

    In your case, since you didn't register the path of your previous data volume container, you will have to do a search in /mnt/sda1/var/lib/docker/volumes/ for a known file.

提交回复
热议问题