1

I can't mount directory. I'm using linux containers on win10.

docker run --rm -v c:\users\pperak:/data alpine ls /data -la
docker run --rm -v /c/users/pperak:/data alpine ls /data -la

ls -la returns

drwxr-xr-x    2 root     root            40 Feb 14 15:29 .
drwxr-xr-x    1 root     root          4096 Feb 14 15:33 ..

https://docs.docker.com/storage/bind-mounts/ says not to use --volume and use --mount instead

docker run --rm --mount type=bind,source=c:\users\pperak,target=/data alpine ls /data -la
docker run --rm --mount type=bind,source=/c/users/pperak,target=/data alpine ls /data -la

But this also doesn't work. What am I doing wrong?

Piotr Perak
  • 10,718
  • 9
  • 49
  • 86

1 Answers1

4

After spending half a day on it I reminded myself that I once had similar problem. Some files not visible and other visible as folders after adding Docker volume (Some files not visible and other visible as folders after adding Docker volume)

It didn't work because I changed password and after you change your password you need to disable sharing drives and enable it again. You will be asked for your password then and it will work again.

Piotr Perak
  • 10,718
  • 9
  • 49
  • 86