6

I updated from Windows 7 to Windows 10 few weeks ago : I was using Docker Toolbox/Virtual Box to work with Docker and I read Docker for Windows was recommended (newest application) but it is a pain for me to make it work as it used to with Toolbox.

I created a docker machine using hyperv and running docker hello-world works.

But when it comes to use volumes, a strange behavior happens : No error messages, container working perfectly but my volume is empty of files inside, I only have folders.

I used to have troubles with Shared Drives but I managed to have it working (through Docker for Win GUI).

Here is a command I try which run a container but does not map Windows files (only folders) :

docker run -ti -v folders/:data/folder alpine

I am running Docker version 18.03.0-ce

Any idea? If I am not clear, please let me give more information! Thx

Marien
  • 75
  • 1
  • 6
  • I am not sure about the root of the problem, but it seems to be solved since I did those actions: >uninstall docker + remove docker env variables >uninstall virtual box >remove hyperv machines >reinstall latest docker for windows >set my external switch as private >share drive through GUI In addition, my company updated some policy on their side. I am now able to mount volume from windows host to Docker container – Marien Apr 27 '18 at 12:23
  • Might be coincident, I did exactly what you tried upgrading to windows 10 and all possible ways to make it work. No luck! But i back to `VirtualBox` instead of `hyper-V` and tried with folder share. It worked for me. Please refer my answer here: https://stackoverflow.com/a/53331648/2179456 – Bala Nov 16 '18 at 05:03

2 Answers2

14

First make sure that your drive is shared (see image below).

One important note is that if you change your windows password then your shared drives will not be able to mount. To fix this simply unshare and reshare your drive or press "Reset credentials...".

Thanks to ctliv for pointing that out in this discussion: https://github.com/docker/for-win/issues/25

enter image description here

Paul Adam
  • 251
  • 1
  • 2
  • 11
  • Thanks Paul for your answer. I had tried all of what you said and it did not work : it really begins to work after : uninstall docker + remove docker env variables uninstall virtual box remove hyperv machines reinstall latest docker for windows set my external switch as private share drive through GUI – Marien May 16 '18 at 14:49
  • 1
    Thanks for the answer. I just wanted to note that after configuring shared drives, setting to sign in with a Microsoft account causes this, too. – Gokhan Sari Jan 02 '19 at 01:41
1

In my case, I was trying to run the docker client in WSL1, using the docker host installed in Windows. The problem is that the docker host can't see the WSL filesystem - it can only see the Windows filesystem. So, you can only mount folders in the Windows filesystem, which uses the following path format:

$ docker run -v c:/source:/dest myImage
Greg
  • 2,476
  • 4
  • 22
  • 28