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

docker-compose.yml: remove volume declaration #491

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rjw57
Copy link
Contributor

@rjw57 rjw57 commented Sep 4, 2017

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/

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/
@envycontent
Copy link
Contributor

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.

@rjw57
Copy link
Contributor Author

rjw57 commented Sep 13, 2017

Good point. I added a few lines to the README in c33f390

@ahaith
Copy link
Contributor

ahaith commented Sep 21, 2017

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 docker-machine create --driver=virtualbox default. N.B. the 'local' volume driver for Mac only works for files in /Users. All of our repos are therefore located within our home directories.

@rjw57
Copy link
Contributor Author

rjw57 commented Sep 21, 2017

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:

In case it isn't already clear, the Linux host support here is currently hazy. You can share your /home or /home/jsmith directory as Users or one of the other supported automount locations listed above, but note that you will then need to manually convert your docker run -v /home/...:... bind-mount host paths accordingly (ie, docker run -v /Users/...:...). As noted in the previous paragraph however, this is likely to change in the future as soon as a more suitable/scalable solution is found and implemented.

Looks like one might need to add a note in the README about this and perhaps link to the PR as a workaround?

Copy link

@Mellysoe02 Mellysoe02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test

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

Successfully merging this pull request may close these issues.

4 participants