Inotify events not triggering under /Users

Expected behavior

Changes to files under /Users on MacOSX should trigger inotify events observable inside container using inotifywait from inotify-tools ubuntu package.

Actual behavior

No events are triggered. However, when mapping /tmp, the events are propagated and can be observed using inotifywait.

Information

$ pinata diagnose -u
OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160521-205650.tar.gz
Most specific failure is: No error was detected
Your unique id is: 4AC8DD0F-78B5-4EE1-B74E-4952B9A7C691
  • Container created using the following command:

docker run -it -v /tmp:/mnt/tmp -v /Users:/Users ubuntu:16.04 bash

Steps to reproduce the behavior

  1. Create the container using command above
  2. Install inotify-tools inside container
  3. Listen for events using inotifywait -rm <file_or_folder>
  4. Create or modify files under /tmp and under /Users on MacOSX
  5. Observe that events are received in container for changes under /tmp; but not received for changes made under /Users

UPDATE: This morning I was testing whether file permissions or ownership on /Users would make a difference and I was both restarting the Docker app and recreating test containers when suddenly notifications started coming through. I’ve restored file permissions and ownership on /Users but the notifications are still working.

At this point I’m unable to reproduce the issue. I am guessing restarting the docker app fixed the issue. Will post further updates if I see the issue again.

UPDATE: Notifications suddenly stopped after working well for a few hours. Restarting container and restarting docker app did not help. However, recreating the container made notifications work again!

OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta13.1
Running diagnostic tests:
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[ERROR]   environment      the variables DOCKER_REGISTRY_PASS DOCKER_REGISTRY_BASE DOCKER_REGISTRY_USER DOCKER_GATEWAY should not be set
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160603-162525.tar.gz
Most specific failure is: the variables DOCKER_REGISTRY_PASS DOCKER_REGISTRY_BASE DOCKER_REGISTRY_USER DOCKER_GATEWAY should not be set
Your unique id is: 89F7BC19-030E-4E42-A396-E86E74332227
Please quote this in all correspondence.

inotifywait doesn’t work for me either even though I didn’t use the symlinked /tmp.
docker run -it -v /private/tmp/:/mnt/tmp ubuntu:16.04 bash

I’m having the same issue with inotify not triggered in mounts under /Users:

Client:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd
 Built:        Fri Jun 17 20:35:33 2016
 OS/Arch:      darwin/amd64
 Experimental: true

Server:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   a7119de
 Built:        Wed Jun 29 10:03:33 2016
 OS/Arch:      linux/amd64
 Experimental: true

Here is some more information:

I am trying to run an app via pm2 with the following configuration:

# process.yaml
apps:
  - name: api
    script: api/index.js
    instances: 1
    exec_mode: fork
    watch: true
    ignore_watch: [".git", "node_modules"]
    watch_options: 
      polling: true

Any changes I make to api/index.js doesn’t cause a restart. Oddly enough, if I remove the .git directory from the ignore list, pm2 reloads perpetually indicating that changes are detected on .git/index.lock

I also tried running inotifywait -r -m on api/index.js and it doesn’t report any changes when I modify them from within OS X.

The command is docker run -v .:/opt/app <my-app>:latest pm2 process.yaml (somewhere under /Users/bez/)

Here is the result of diagnostics:

Docker for Mac: version: mac-v1.12.0-beta17
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160629-172001.tar.gz
[OK]     docker-cli
[OK]     app
[OK]     menubar
[OK]     virtualization
[OK]     system
[OK]     osxfs
[OK]     db
[OK]     slirp
[OK]     moby-console
[OK]     logs
[OK]     vmnetd
[OK]     env
[OK]     moby
[OK]     driver.amd64-linux