Purpose of Docker Native for Windows ? docker-compose in a running docker-machine using Docker for Windows hyperv drive, How does mount work?

Let’s begin by I’m confused. After a day spent understanding & implementing solutions, all works great with containers run on host machine:

  • Shared Drives in Docker settings, after creating a user with full access credentials, to allow Docker to mount folders through. :heavy_check_mark:
  • Network switch for virtual VMs to use with bridge to another adapter for internet access. :heavy_check_mark:

i.e. running “docker run --rm -v $(PWD):/data alpine ls /data” works as expected.

What I’m struggling to understand, relates to mounting folders inside a docker-machine. Coming from a Vagrant & Virtualbox world, the mount is specified when machine is created. But using Docker for Windows where does docker-machine mount reside ?

  • e.g. Sending docker-compose command to a locally created docker-machine, where the docker-compose file resides in the host machine (current directory), starts to build the containers and fails for not finding the host files (that should be mounted). ✘

Well, it is expected I understand, since the files only exist locally on the host machine, not in the docker-machine VM. It seems impossible to do so with no mount defined (at least to my understanding).

Which raises the question:

Is Docker for Windows intended to creating multiple local docker-machines, which each one runs services of their own (using swarm for example) ? Or is it limited to one environment (Windows) where containers run and share resources inside ?

& What about mounted folders inside local docker-machines ? Does it support VM mounts ?


Currently, I’m rolling back to using VirtualBox to follow DevOps 2.1 Toolkit book.
Thanks

Using:

  • Windows 10 Pro, HyperV enabled machine, using PowerShell & Git Bash as administrator
  • Docker for Windows: Version 1.13.0-rc4-beta34 (9562) Channel: Beta 2645901
1 Like

It’s limited to one environment. See these tutorials on how to use Docker for Windows in conjunction with docker-machine to create additional hyper-v VMs to experiment with multi-node swarms: https://github.com/docker/labs/tree/master/swarm-mode/beginner-tutorial

@friism I see, these examples do not use mounted folders in the local docker machines… Does “Docker native for Windows” support mounts from the host filesystem to a locally created virtual docker-machine ?
Thanks

Not when using the hyper-v docker-machine driver. It might work with the virtualbox driver.

1 Like

Thanks Michael.
This should be mentioned in the docs. Added a request https://github.com/docker/docker.github.io/issues/994