Docker Community Forums

Share and learn in the Docker community.

Cannot add path to access Windows file system folder in Linux image

(Fmonfort) #1

Expected behavior

When typing:

docker run -v “C:\Users\Florian Monfort”:"/data" -it ubunty:trusty

And then doing ls in the image which contains a Ubuntu OS, the folder added from the Windows file system should be available.

Actual behavior

ls does not return the expected folder.


So basically the problem is we can’t figure out how to use the -v option on Windows with windows folder paths to make it work.

Steps to reproduce the behavior

  1. Create a Docker image with a Linux based distro;
  2. Try to run this image with the -v option in order to make a folder path accessible on /

Using latest version of Docker for Windows, 1.12.0

(Miroki) #2

I can confirm this issue. I am a Windows 10 user and I’ve just upgraded the system to Redstone.
I’ve spent the entire afternoon trying to get it work.
My case is super easy: get an Nginx running on Ubuntu to serve files that reside on Windows.
I have tried everything from -v c:/Users/website:/var/www/html/website to -v /c/Users/website:/var/www/html/website
Using docker inspect I can verify the mount is there:
“Mounts”: [
“Source”: “/c/Users/website”,
“Destination”: “/var/www/html/website”,
“Mode”: “”,
“RW”: true,
“Propagation”: “rprivate”

but it simply doesn’t work.

(Miroki) #3

This is my very first time to this forum.
One minute later, I’ve found the reason why it doesn’t work: you need to implicitly give privileges to docker in order for it to have the proper rights to get access your drives. FYI: Volume mounts in windows does not work