-
Notifications
You must be signed in to change notification settings - Fork 5
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
docker-compose.yml: remove volume declaration #491
base: master
Are you sure you want to change the base?
Conversation
When using docker-machine as recommended in the README file, the instructions for getting started do not work since the web application container fails to start. That's because the default "local" driver for Docker volumes doesn't work directly with docker-machine (see [1] for a discussion of this). The existing Dockerfile already copies the web application files to the container and removing the volume configuration allows the web application to start. Database migration and initial user creation can then be performed. If the volume configuration is kept, the ``manage.py`` script cannot be found because the ``/code`` directory appears to be empty. The downside of this change is that changes to the local files will not be reflected until a ``docker-compose build web`` command is issued. Depending on how a local developer prefers to work, this may lead to confusion. [1] https://alexanderzeitler.com/articles/docker-machine-and-docker-compose-developer-workflows/
I've tried this out - as a complete newbie using the docker option and it worked fine. Would help to have the additional step (docker-compose build web) in the readme as well. |
Good point. I added a few lines to the README in c33f390 |
Hi Rich, Thanks for the PR. The steps as described for us work fine. i.e. the code directory is mounted successfully and any changes made on the host are immediately reflected within the container. The server restarts automatically whenever code changes. Hopefully we can figure out why the mounting isn't working for you, and update the ReadMe with some relevant guidance. We are all using OSX, and are running our containers on a local vm created by |
I'm using docker-machine with Virtualbox driver under Linux. Doing some more digging, it appears that local volumes with Virtualbox don't work well on Linux. See docker/machine#1376 and https://github.com/boot2docker/boot2docker/#virtualbox-guest-additions specifically:
Looks like one might need to add a note in the README about this and perhaps link to the PR as a workaround? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test
When using docker-machine as recommended in the README file, the
instructions for getting started do not work since the web application
container fails to start.
That's because the default "local" driver for Docker volumes doesn't
work directly with docker-machine (see [1] for a discussion of this).
The existing Dockerfile already copies the web application files to the
container and removing the volume configuration allows the web
application to start. Database migration and initial user creation can
then be performed. If the volume configuration is kept, the
manage.py
script cannot be found because the/code
directoryappears to be empty.
The downside of this change is that changes to the local files will not
be reflected until a
docker-compose build web
command is issued.Depending on how a local developer prefers to work, this may lead to
confusion.
[1] https://alexanderzeitler.com/articles/docker-machine-and-docker-compose-developer-workflows/