Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Virtualbox shared volumes not picking up changes #3222

Closed
cmheisel opened this issue Mar 23, 2016 · 8 comments
Closed

Virtualbox shared volumes not picking up changes #3222

cmheisel opened this issue Mar 23, 2016 · 8 comments

Comments

@cmheisel
Copy link

With docker-machine 0.6 and Virtualbox 5.0.16 with OS X I've encountered situations where changes to files on my Mac filesystem that are shared via docker-compose volumes aren't picked up by the running docker container.

I've got more details and a test script here: https://github.com/cmheisel/docker-machine-fstest

It seems like installing docker-machine-nfs resolves the issue

Interestingly, it seems like using Alpine base images exposes the issue, at least with Python apps.

@thaJeztah
Copy link
Member

I think this may be because VirtualBox shared folders don't support inotify (and they won't be supporting that, see: https://www.virtualbox.org/ticket/10660)

Also see moby/moby#18246, which has some more related issues linked

@cmheisel
Copy link
Author

@thaJeztah I didn't think about inotify support. That would explain the live-reloading.

I'm seeing the same behavior if you docker-compose stop and docker-compose up to restart the containers, the change you made doesn't show. I updated my test script to verify. That seems like something larger than inotify support.

@thaJeztah
Copy link
Member

A colleague just mentioned that this could be due to sendfile not working on vboxsf. Don't know if there's an option to disable that in your python app?

@cmheisel
Copy link
Author

@thaJeztah What's weird is the python app reloads on change with Debian-based distros, but not Alpine-based. And that Nginx isn't picking up changes either live or after a container restart

What I've found is below, with the really weird stuff in bold:

Distro/App Changes appear on file change Changes appear on container restart
Alpine/Flask NO NO
Alpine/Nginx NO NO
Debian/Flask Yes Yes
Debian/Nginx NO NO

@thaJeztah
Copy link
Member

Nginx may be partly related to sendfile (also see http://serverfault.com/questions/269420/disable-caching-when-serving-static-files-with-nginx-for-development), although it surprises me that it doesn't pick up those changes even after a container restart. Perhaps @ncopa has an idea what difference Alpine makes in this situation.

You may be interested in https://blog.docker.com/2016/03/docker-for-mac-windows-beta/, which solves a lot of issues in this area

@cmheisel
Copy link
Author

@thaJeztah I got access to the beta and all the tests passed with that, so it must be virtualbox/vboxfs related.

@thaJeztah
Copy link
Member

@cmheisel excellent! Enjoy the beta, I hope you like it!

@nathanleclaire
Copy link
Contributor

Closing this as nothing seems actionable on our end

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

No branches or pull requests

3 participants