Skip to content

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

Closed

Description

@laggingreflex

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

Activity

  1. shin- commented on Sep 9, 2016

    @shin-

    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.

  2. laggingreflex commented on Sep 11, 2016

    @laggingreflex
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions