When creating / removing / updating a file / folder in a mounted folder, inotify events are triggered inside the container
Under certain conditions, no inotify events are triggered.
I encountered this issue while working on a sync project to increase the performance of docker volumes.
Basically, it launches an unison server in a container and performs syncs in realtime by watching two folders in the container: a normal one and one mounted to the host OSXFS. Syncing from the container to the host, always work. However, it looks like syncing from the host to the container stop / doesn’t work under certain conditions…
I tried to reproduce these conditions by creating a simple example that you can grab at https://github.com/mickaelperrin/docker-magic-sync/tree/feature/1.
Docker for Mac: version: mac-v1.12.0-beta20
OS X: version 10.11.5 (build: 15F34)
Steps to reproduce the behavior
#1. get the example from Github git clone -b feature/1 https://github.com/mickaelperrin/docker-magic-sync #2. start the containers cd docker-magic-sync/example ./compose.sh up -d --build # 3. launch inotify in the container docker exec -it example-magic_sync_1 inotifywait -m /src/project.magic # 4. open a new terminal and go to subfolder example touch newfile # 5. check that no notification is emitted by inotifywait # 6. ensure the file is created docker exec -it example_magic-sync_1 sh -c "test -f /src/project.magic/newfile && echo 'No events were emitted but file was created'"