Inotify is not triggering any events in docker when we mount it from the host

inotify is not triggering any events in docker when we mount it from the host
Docker version 20.10.2,

i have a python script which monitor the content file and do some operation, when we mount the data from the host, no inotify events will get triggered,
if i manually change the file inotify event is getting triggerred ,

anyone please help here any help si appreciated

I have the same issue , any solution ?

I run a containerized application that depends on inotify a lot and it works like a charm.

In my case, the inotify events are registered inside the container and filesystem changes are done outside the container, the application inside the container becommes notified and handles the event.

Of couse this only works for files handled directly on the host (where the host’s kernel can register and notify filesystem events).

It does not work for mount points of remote shares (cifs/nfs), where files are modified outside the host on the remote share itself (directly on the remote server, other clients).

Same issue here. This is preventing edit refresh (live hot reloading) for flask. Works fine when editing on the container system but not in the host. Verified with inotifywait that notifications aren’t happening. I’m on kubuntu 22 (Ubuntu 18.04.6 LTS) with Docker version 20.10.17, build 100c701. I was not having this issue until I recently reinstalled my system clean. Previously also had Kubuntu 22 (slightly different version) and possibly an earlier version of docker. This makes me think there’s some regression here in how docker handles shared volumes between the host and the containers.

Downgrading to 20.10.14 solved my problem. Note also the github issue here: Hot reloading is not triggered after upgrading to Docker Desktop · Issue #30 · docker/desktop-linux · GitHub

1 Like