django - local files missing from docker-machine container -
so have simple containerised django project, container sass css compilation.
i use docker-compose docker-machine, when fire up, web container doesn't have of local files (manage.py etc) in, dies file not found: manage.py
error.
let me explain more:
docker-compose.yml
web: build: . volumes: - .:/app ports: - "8001:5000" sass: image: ubuntudesign/sass command: sass --debug-info --watch /app/static/css -e "utf-8" volumes: - .:/app
dockerfile
from ubuntu:14.04 # install apt dependencies run apt-get update && apt-get install -y python-dev python-pip git bzr libpq-dev pkg-config ubuntu:14.04 # install apt dependencies run apt-get update && apt-get install -y python-dev python-pip git bzr libpq-dev pkg-config # pip requirements files copy requirements /requirements # install pip requirements run pip install -r /requirements/dev.txt copy . /app workdir /app cmd ["python", "manage.py", "runserver", "0.0.0.0:5000"]
and standard django project in local directory:
$ ls docker-compose.yml dockerfile manage.py readme.md static templates webapp
and here's error isolated can make it:
$ docker-compose run web python
can't open file 'manage.py': [errno 2] no such file or directory
which true:
$ docker-compose run web ls
static
i think problem working remote docker-machine
s, i've tried follow simple django tutorial, , reckon local file sharing works differently.
what works differently when using docker-machine?
docker volumes mount files host container.
so in case, you've mounted current directory of whatever host docker-machine pointing container. unless have funky vm crossmounting going on (like boot2docker does), isn't going match directories on machine you're running on.
Comments
Post a Comment