I am using fig to mount my OS X directory through the boot2docker host vm. I am using the already provided Users directory. Try the following:
/code/Tryme.txt - "Hello there"
Change the content of the Tryme.txt - "Hello foobar"
When you get the file again, you get the original text: "Hello there"
So What am I missing? Any ideas? If I take the container down and bring it back up, the file is as it should be. When I nsenter the image, the file is changed as it should be as well.
Ideas?
Thanks.
Update: I have seen this as well with my application code serving the file up and it still doesn't change. I wanted this to be a dev environment for quick turn around, but it doesn't seem to work like expected.
You might want to add this configuration in nginx:
sendfile off;
Personally, I avoid serving anything out of a shared folder because of these types of inconsistencies. Run a simple watch script that kicks off an rsync inside your container from your shared folder volume to a container-only volume whenever anything changes. Then, have nginx serve from your container-only volume (/var/www
below). Example fig:
volumes:
- ~/code:/code
- /var/www