Open john-paul-keenan opened 9 years ago
Does $PWD work? Can you try that?
I don't have access to a windows machine. Do you think a virtual machine running windows would work because I can make one of those, or would running a vm in a vm be too much?
I was able to test on Irina's machine and no, $PWD does not work either
Hmm, might have to use the full path for windows as it shows here: https://docs.docker.com/userguide/dockervolumes/#mount-a-host-directory-as-a-data-volume
On Fri, Oct 9, 2015 at 2:57 PM John Paul Keenan notifications@github.com wrote:
I was able to test on Irina's machine and no, $PWD does not work either
— Reply to this email directly or view it on GitHub https://github.com/iron-io/dockerworker/issues/17#issuecomment-146995690 .
I'm running docker on Windows and using Kitematic (the GUI) created a Linux VM via Oracle Virtual Box. I launch it using Docker Toolbox Terminal.
From within the Docker terminal window (which is a Linux VM) I got it working by putting an extra '/' in front of the volume and working directory paths:
docker run --rm -v "/$(pwd)":/worker -w //worker iron/images:...
Install docker (which includes Oracle VirtualBox) on Windows from here: http://docs.docker.com/engine/installation/windows/
FYI - after installation I had issues starting Kitematic and manually launching the Docker terminal until I enabled the VirtualBox Bridged Networking Driver :-P.
When runnig Docker for Windows and Powershell, you can simply use the full path. Here is an example:
PS C:\Users\tomtz\dev\dfc> ls Directory: C:\Users\tomtz\dev\dfc
Mode LastWriteTime Length Name
d----- 1/15/2017 9:28 AM background d----- 1/15/2017 9:28 AM bin d----- 1/17/2017 9:03 AM bisonflexexamples d----- 1/15/2017 9:28 AM environment d----- 1/15/2017 9:28 AM grammars d----- 1/15/2017 9:28 AM images d----- 1/15/2017 9:28 AM js d----- 1/15/2017 9:28 AM kernels d----- 1/17/2017 1:39 PM src d----- 1/15/2017 9:28 AM tests -a---- 1/16/2017 9:01 PM 207 Dockerfile -a---- 1/15/2017 9:28 AM 1111 LICENSE -a---- 1/15/2017 9:28 AM 1187 README.md -a---- 1/15/2017 9:28 AM 1170 test-page.html
PS C:\Users\tomtz\dev\dfc> docker run -it -v C:\Users\tomtz\dev\dfc:/usr/src/dfc dfc root@48acc5ca903f:/usr/src/dfc# ls Dockerfile LICENSE README.md background bin bisonflexexamples environment grammars images js kernels src test-page.html test
Anything I try in git bash or PS that pertains to obtaining the paths returns double backslashes that confuse the docker -v parser. ( I tried: $PWD, PWD, $pwd.Path)
I've been using ${pwd}
in powershell which also works in Linux which is nice. For instance:
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 iron/functions
Using this here: https://github.com/iron-io/functions/blob/master/docs/operating/windows.md
The docker run --rm -v "$(pwd)":/worker -w /worker iron/images:... command will not work in Windows because $(pwd) is a Unix command.
To correct this issue, the actual path needs to be entered in.