Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Docker Quickstart Terminal replaces coloms by semi-coloms #80

Closed
jdevora opened this issue Aug 13, 2015 · 16 comments
Closed

Docker Quickstart Terminal replaces coloms by semi-coloms #80

jdevora opened this issue Aug 13, 2015 · 16 comments

Comments

@jdevora
Copy link

jdevora commented Aug 13, 2015

I'm trying to execute a container mapping the current directory on Windows, using the new "Docker Quickstart Terminal".

The problem is that the paths get changed before executing docker.

$ docker run  -v /c/Users/myuser/test:/project ubuntu:14.04 
invalid value "c:\\Users\\myuser\\test;C:\\Program Files (x86)\\Git\\project" for  flag -v: bad mount mode specified : \Program Files (x86)\Git\project
See 'c:\Program Files\Docker Toolbox\docker.exe run --help'.

As you can see a valid path with the old boot2docker gets converted to a pseudo Windows style path replacing the : that separates the host and the container directories to a ;

Using a Windows style path doesn't help either

@mchiang0610
Copy link
Contributor

@jdevora Thanks for reporting this. We will look into this problem.

@doxxx
Copy link

doxxx commented Aug 15, 2015

Try //project. This is something that the MSYS environment does to map POSIX paths to Windows paths before passing them to executables.

@SvenDowideit
Copy link
Contributor

ah, thank goodness this wasn't just something odd about my windows 10 box :) - confirmed.

@likol
Copy link

likol commented Sep 4, 2015

same issue for me, and thanks @doxxx , it's worked!

OS: Windows 10
Toolbox version: 1.8.1c

@acuthbert
Copy link

Same for me. This is really frustrating as I can't get any tutorial to work. I can't even use docker-compose as I'm using the container method for that, and it requires the -v switch too:

$ docker-compose up
invalid value "C:\\Program Files\\Git\\var\\run\\docker.sock;C:\\Program Files\\Git\\var\\run\\docker.sock" for flag -v: bad mount mode specified : \Program Files\Git\var\run\docker.sock
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

@doxxx I've tried putting the extra slash at the start of the path on the right hand side of the colon but then I get "Bad Address" instead:

bash: /c/Program Files/Docker Toolbox/docker: Bad address

@doxxx
Copy link

doxxx commented Sep 9, 2015

@acuthbert Docker Toolbox does not include docker-compose on Windows as it is not currently supported as far as I know.

@doxxx
Copy link

doxxx commented Sep 9, 2015

@acuthbert What you can try doing as a workaround for Windows though, is to SSH into the VM created by docker-machine and install and run docker-compose directly there.

@tryjude
Copy link

tryjude commented Sep 12, 2015

For anyone else having this problem I found a comment in another thread that helped clear it up. The double slash has to be at the beginning. Not after the colon.

Here is my working example now:

docker run -d -p 5000:5000 -v //c/Users/jude/helloapp:/opt/flask-intro --name web flask-intro

HTH

@timshephard
Copy link

Thanks tryjude, that helped with the "bad address" problem.

@chefhoobajoob
Copy link

@tryjude : this works for me too - thanks!

@evbo
Copy link

evbo commented Jan 24, 2016

the suggestion to put two slashes, "//c/", is not working for me. It creates the folder inside your docker container, but there is no persistence from my local C drive (files inside that folder are non-existent.

If you've gotten it to work using the double slashes, please give your full steps as my conclusion is either correct or misguided.

@thaJeztah
Copy link
Member

@evbo make sure that the Windows path is somewhere inside c:\Users, because by default, that's the only path shared with the virtual machine

@SvenDowideit
Copy link
Contributor

This looks to have been fixed for the docker binary when run from bash and cmd.exe

sven@DESKTOP-Q9P9MVC MINGW64 ~/src (main)
$ docker run  --rm -it -v /c/Users/sven/test:/project debian ls
bin   dev  home  lib64  mnt  proc     root  sbin  sys  usr
boot  etc  lib   media  opt  project  run   srv   tmp  var
sven@DESKTOP-Q9P9MVC MINGW64 ~/src (main)
$ docker run  --rm -it -v /c/Users/sven/test:/project -w /project debian pwd
/project

however, there are issues when you're using something else - for example, #397

so - @JeffDM can we close this one?

@evbo
Copy link

evbo commented Feb 7, 2016

Persisting only within the Windows "Users" directory is a bit too restrictive for some needs. Here is a work around that I use on a daily basis now:

first, ensure (using the GUI) that virtualbox has a shared folder setup to your liking (in this case we will map to a c:\work folder). Open Docker Toolbox. then, ssh into your virtual machine
docker-machine ssh default

get to your root directory in the linux machine
cd /

create a directory to share (persist) data with your local machine
sudo mkdir work

mount the shared folder named "work" to the "/work" dir inside the Boot2Docker VM
sudo mount -t vboxsf work /work

run the container with the mounted "/work" volume located at "/work" inside the container

docker run --volume /work:/work \
--name "someContainer" \
--rm -i -t [some container]

@jmorganca
Copy link
Contributor

@SvenDowideit indeed. Thanks for pinging me!

@w23ta0
Copy link

w23ta0 commented Jul 7, 2016

@doxxx Thanks

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

No branches or pull requests