How to extract volume from a remote docker container?

If I have a data volume container and I stop and delete the container (without the -v flag, which deactivates the volume), can I still start a new data volume container with a lost volume? Or data is lost?

+5
source share
1 answer

If you delete the container with docker rm but without the -v flag, your data will still be available in the /var/lib/docker/vfs/dir/<your-volume-id>/ directory on the host.

To use the lost volume in the new docker container, you can mount this directory from the host or connect a new empty volume to the docker container and then synchronize the data.

+6
source

Source: https://habr.com/ru/post/1203278/


All Articles