Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix Commands in Windows Environments. #17

Open
john-paul-keenan opened this issue Sep 23, 2015 · 7 comments
Open

Unix Commands in Windows Environments. #17

john-paul-keenan opened this issue Sep 23, 2015 · 7 comments

Comments

@john-paul-keenan
Copy link
Contributor

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.

@treeder
Copy link
Contributor

treeder commented Oct 2, 2015

Does $PWD work? Can you try that?

@john-paul-keenan
Copy link
Contributor Author

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?

@john-paul-keenan
Copy link
Contributor Author

I was able to test on Irina's machine and no, $PWD does not work either

@treeder
Copy link
Contributor

treeder commented Oct 11, 2015

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 [email protected]
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
#17 (comment)
.

@secretchaingirl
Copy link

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.

dockertools

vboxinfo

@Ravenwater
Copy link

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)

@treeder
Copy link
Contributor

treeder commented Jan 18, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants