title: docker check for changes on mounted file system
body: <p>I wanted to make a ruby build environment within a docker container. Ruby is installed in the container and I can develop on my win10 host machine. I mount my host-working directory to the container and build the project. But now I thought about a little quality of life improvement: Wouldn't it be great if the container just listens on the mounted file system, and builds whenever I change something in my project?</p>
  
  <p>After 5mins of google I found inotifywait which, at first sight, looked great, so I first tried it <strong>without</strong> mounting the filesystem:</p>
  
  <pre><code>[root@a3193720c4f1 testfolder]# inotifywait -m /tmp/testfolder/ -e modify -e create -e open |
  &gt;     while read path action file; do
  &gt;         echo "The file '$file' appeared in directory '$path' via '$action'"
  &gt;     done
  Setting up watches.
  Watches established.
  The file '' appeared in directory '/tmp/testfolder/' via 'OPEN,ISDIR'
  The file 'newfile' appeared in directory '/tmp/testfolder/' via 'OPEN'
  </code></pre>
  
  <p>This worked out, but <code>/tmp/testfolder</code> is not the mounted directory, it's just a test-directory that I created in my container to get used to the inotifywait command. So this time I started my container and mounted the directory:</p>
  
  <pre><code>docker run -it --rm -v "D:\LokaleDaten\ELK_Docker\Docker\RVM\testfolder":"/tmp/testfolder" -w "/tmp/testfolder" myrvm
  </code></pre>
  
  <p>Then I started the inotifywait again, changed a file (on the host system which is mounted to the container), but the inotify didn't catch the changed file. I also checked if the file is changed in the container, and yes, the changes were made. 
  So I am curious if I missed something, or is inotify not the right tool for that?</p>
  
  <p>Kind regards, Manuel</p>