Skip to content

Volume is not shared on windows 10 #3960

Closed

Description

@mic0331

When building windows containers a compose file like:

version: '2'
services:
  web:
    build: .
    ports:
      - "5000:5000"
    volumes:
      - .:/code
    links:
      - db
  db:
    image: mongo:3.2.9

with a docker file like:

FROM python:3.5

ENV APP_ROOT /code

WORKDIR ${APP_ROOT}
ADD ./requirements.txt ${APP_ROOT}/
RUN pip install -r requirements.txt

ADD . ${APP_ROOT}/

EXPOSE 5000

CMD ["python", "manage.py", "runserver"]

The local volume is not shared with the container. Doing docker logs on the web container:

python: can't open file 'manage.py': [Errno 2] No such file or directory

When running docker-compose --verbose config

compose.config.config.find: Using configuration files: .\docker-compose.yml
networks: {}
services:
  db:
    image: mongo:3.2.9
  web:
    build:
      context: C:\Users\mic03\Projects\flaskbook\flaskbook_prj
    links:
    - db
    ports:
    - 5000:5000
    volumes:
    - /c/Users/mic03/Projects/flaskbook/flaskbook_prj:/code:rw
version: '2.0'
volumes: {}

The command net share c confirm access has been granted to the drives:

PS C:\Users\mic03\Projects\flaskbook\flaskbook_prj> net share c
Share name        C
Path              C:\
Remark
Maximum users     No limit
Users
Caching           Caching disabled
Permission        DESKTOP-VFK5FP7\DockerHost, FULL

The command completed successfully.

Running the container without docker-compose is working. Any idea ?

Activity

  1. mic0331 commented on Sep 19, 2016

    @mic0331
    Author

    For info I run

    • docker version 1.12.1, build 23cf638
    • docker-compose version 1.8.0, build d988a55

    Thanks

  2. shin- commented on Sep 20, 2016

    @shin-

    Is the drive you're working from enabled as a shared drive? See here for more info.

  3. mic0331 commented on Sep 20, 2016

    @mic0331
    Author

    @shin- Sure my drives are all shared following the procedure as describe in your link.
    For info I tested the exact same code on my ubuntu partition and it works perfectly so i suspect it is really windows specific issue.

  4. PatrickLang commented on Sep 21, 2016

    @PatrickLang

    @mic0331 could you share the first few lines of your Dockerfile so we can see what image(s) you're using?

    @shin- If he's running a Windows-based container, the sharing options in Docker for Windows may not be needed. Windows can share individual folders (see #3922) without sharing a whole drive. They won't show up in net use

  5. mic0331 commented on Sep 23, 2016

    @mic0331
    Author

    @PatrickLang here is my Dockerfile for the "web" container.

    FROM python:3.5
    
    ENV APP_ROOT /code
    
    WORKDIR ${APP_ROOT}
    ADD ./requirements.txt ${APP_ROOT}/
    RUN pip install -r requirements.txt
    
    ADD . ${APP_ROOT}/
    
    EXPOSE 5000
    
    CMD ["python", "manage.py", "runserver"]
    
  6. PatrickLang commented on Oct 5, 2016

    @PatrickLang

    @mic0331 sorry I forgot to update earlier. That's a Linux container which would be running in MobyLinuxVM. The other issue #3925 I was looking at isn't related since it was for a Windows container.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions