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

Cannot provide paths to docker run in windows #18290

Closed
atrauzzi opened this issue Nov 28, 2015 · 11 comments
Closed

Cannot provide paths to docker run in windows #18290

atrauzzi opened this issue Nov 28, 2015 · 11 comments

Comments

@atrauzzi
Copy link

When I try to run this: winpty docker run --volume="./laravel:/app" composer/composer "$@", I get the following error:

invalid value "`.\\laravel:\\app`" for flag --volume: \app` is not an absolute path
See 'docker run --help'.

Running: Docker version 1.9.1, build a34a1d5

@GordonTheTurtle
Copy link

Hi!

Please read this important information about creating issues.

If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.

This is an automated, informational response.

Thank you.

For more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues


BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:

docker version:
docker info:
uname -a:

Provide additional environment details (AWS, VirtualBox, physical, etc.):

List the steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Provide additional info you think is important:

----------END REPORT ---------

#ENEEDMOREINFO

@thaJeztah
Copy link
Member

Hm, sounds like the windows shell converting slashes to backslashes, I think there are some other issues about that, and iirc, there was as workaround to prevent it being "smart".

I do see, however, that you're trying to use a relative path (.\\laravel) for the host path, that's not supported, and should be an absolute path (e.g. C:\Users.....)

@thaJeztah
Copy link
Member

I think this discussion describes it; #13741, and this link http://www.mingw.org/wiki/Posix_path_conversion

@atrauzzi
Copy link
Author

Requiring an absolute path is not practical though. This is in the context of a shared project. Not everyone will put it in the same location on their machines.

@atrauzzi
Copy link
Author

Also, I'm using docker toolbox, not cmd or power shell.

@thaJeztah
Copy link
Member

Requiring an absolute path is not practical though. This is in the context of a shared project. Not everyone will put it in the same location on their machines.

You could consider using docker-compose; docker-compose allows you to define bind-mounted volumes relative to the location of the docker-compose.yml file. Using a docker-compose file allows you to specify all options needed to run your containers in a single file, which makes it ideal for sharing between team members (ie, just run docker-compose up -d will start all containers for the project with the right options).

On Linux, using --volume $(pwd)/laravel:/app/ is usually the way to convert the current directory to an absolute path (but not sure if there's an alternative to that on Windows 😊)

Also, I'm using docker toolbox, not cmd or power shell.

IIRC, toolbox basically starts a cmd or powershell session, with the environment set up to connect to your virtual machine but I don't have access to a Windows box currently, so I'm not able to test a.t.m.

/cc @JeffDM for Docker Toolbox, because this is more an issue with docker-toolbox than docked

@atrauzzi
Copy link
Author

I'm already using compose to simulate an environment. This is just a one off command.

@jmorganca
Copy link
Contributor

Thanks @thaJeztah.

@atrauzzi I'll investigate the path conversion in docker/toolbox on Windows

@jmorganca
Copy link
Contributor

See docker-archive/toolbox#282

Thanks!

@thaJeztah
Copy link
Member

Thanks @JeffDM

@atrauzzi let's continue the discussion in docker-archive/toolbox#282. I'll close the issue here

@krishna81m
Copy link

This hack seems to work like a charm if you have downgraded to 1.9 from the AUFS issues in 1.9.1

docker create -v //c/Users/myuser:/myuser --name data hello-world
winpty docker run -it --rm --volumes-from data ubuntu

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

5 participants