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

Relative paths for host mounted volumes not working on Windows #3925

Closed
laggingreflex opened this issue Sep 9, 2016 · 2 comments
Closed

Comments

@laggingreflex
Copy link

laggingreflex commented Sep 9, 2016

Description

It seems mounting a host directory as a data volume with relative path to current host dir using docker-compose no longer works in Windows.

version: '2'
services:
  test:
    build:
      context: ./
    volumes:
      - .:/test

I've tested it with Windows 10, Docker version 1.12.1, docker-compose version 1.8.0, which didn't work. And on Ubuntu 14, Docker version 1.12.0, docker-compose version 1.9.0dev, which works as usual.

Steps to reproduce:

  1. Clone https://github.com/laggingreflex/docker-test
  2. Run it on windows, and for comparison run it on Linux

Expected result:

The current dir which is mounted should be ls-ed and its contents output.

CMD ls /test

Actual result:

On windows it outputs nothing (ls of an empty dir, means it didn't actually mount). Works on Linux, shows the two files of the test project.

Absolute paths still work as usual, like

   volumes:
      - /c:/test
@shin-
Copy link

shin- commented Sep 9, 2016

Thank you for your report!

I believe #3922 would solve your issue. If you don't mind trying the branch in your windows environment and reporting with results, that would be a great help.
Another possible workaround would be to add a / in your local path, as such:

volumes:
  - ./:/test

Let me know if that helps.

@laggingreflex
Copy link
Author

It was actually an error on my part. I needed to enable the Shared Drives option. x_x

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

No branches or pull requests

2 participants