Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The docker run -v will mount a volume, but on Windows it is defaulted to C:\Users\<user home>.  On windows when you type docker run -v <host path>:<container path> the container gets a new mounted location <container path> that is mapped to <host path>.  If you specify the same <host path> in another docker run for the same or different image, the new container will share the same directories and files as all other containers that reference <host path>.  In actual fact on Windows <host path> is a volume within the docker-machine not within the Windows host itself; this is an anomaly because in Linux it would be a path within the Linux host environment. 

You can actually use docker volume create to create a new volume, then either use docker run -v <new volume> which will mount it to /<new volume> within the container or, docker run -v <new volume>:<container path> which will mount it to <container path> within the container.

  • No labels