Docker Community Forums

Share and learn in the Docker community.

Docker run --volumes does not include the files within the host directory


(W7pea) #1

This is what I’m seeing, anyone have a workaround or can educated me on what I’m doing wrong. I’ve figured out the first part which is you have to use the “/” paths as opposed to the windows “” format. And you have to prepend the HOST and the CONTAINER folders with “//”. I got that far, and others seem to say it then worked for them, but for me I don’t see any files withing the folders.

Thanks a lot for the help!

Summary:
docker run --volume does not work from the docker CLI launched from kitematic NOR does it work when used in the docker quickstart terminal.

Quickstart Terminal Example

MINGW64 /c/CloudStation/Documents/PycharmProjects/YOURAPP
$ docker run --volume=//c/CloudStation/Documents/PycharmProjects/YOURAPP/://source busybox ls -R source
source:

No files shown, but they are there… as you can see from the quickstart cli.

MINGW64 /c/CloudStation/Documents/PycharmProjects/YOURAPP
$ ls -R
.:
YOURAPP/  manage.py*

./YOURAPP:
__init__.py  settings.py  urls.py  wsgi.py

##Docker CLI Example (Launched from Kitematic)

PS C:\CloudStation\Documents\PycharmProjects\YOURAPP> docker run --volume=//c/CloudStation/Documents/PycharmProjects/YOU
RAPP/://source busybox ls -R source
source:

Again, there are files… but they did not show up when mounted as a volume.

PS C:\CloudStation\Documents\PycharmProjects\YOURAPP> dir
    Directory: C:\CloudStation\Documents\PycharmProjects\YOURAPP
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         1/5/2016   1:43 PM                YOURAPP
-a----         1/5/2016   1:43 PM            250 manage.py

##Linux Comparison
I should mention, on an Ubuntu VM running on the same Windows 10 host, accessing the same folder via Virtualbox shared folders I can see the files.

:~/yourapp$ docker run --rm=true --volume=/media/sf_CloudStation/Documents/PycharmProjects/YOURAPP:/source busybox ls -R source
source:
YOURAPP
manage.py

source/YOURAPP:
__init__.py
settings.py
urls.py
wsgi.py

##Environment

Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      windows/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      linux/amd64

(Cdaf) #2

Did you ever get this to work? I have the same challenge and see this is a couple of years ago when asked.