Where is the mount point of an external volume located on a windows 10 host machine when using docker compose v3? e.g. The host path for mydata when the top-level volumes key is set as follows:
volumes:
mydata:
external: true
I found out that external volume is just a volume that has been created outside of Docker Compose and it is still located inside docker's vm:
C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx in my case.
For sharing data between my host and the containers I can define standard volumes inside the compose services and specify my preferred host directory there, or use local persist plugin
("Create named local volumes that persist in the location(s) you want").
Using external makes docker search for a folder named what you called it - in your case mydata
.
If this folder doesn't exist there will be no mount and no error will be raised.
https://docs.docker.com/compose/compose-file/compose-file-v3/#external
You can also use the inspect to see the exact location:
Docker inspect -f "{{json. Mounts}}" container_name | jq.
https://container-solutions.com/understanding-volumes-docker/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With