Specify location of volumes in docker
I need to create a container specifying the location of volumes (not a bind mount).
The container has a volume /var/www, is possible to choose the location on the host machine? (i want to save in /data/www not in /var/lib/docker….). I can’t do with -v (bind mount) the /var/www folder has data.
One Solution collect form web for “Specify location of volumes in docker”
I can’t do with -v (bind mount) the /var/www folder has data.
The first order of business would be to get those data on your host (in your host /data/www): run your container, and
docker inspect it in order to get the path of the volume it uses (the one in
/var/lib/docker/volumes/...): you can copy those files onto your host.
Then you can bind mount that host
/var/www folder to your container.
But the better practice remains to use volumes (with the new 1.9+
docker volumes API), and mount it with