Docker Community Forums

Share and learn in the Docker community.

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

It looks like file system events just don’t work when Docker is running in Hyper-V and the changes happen on the host. But, it’s possible to work around that limitation by enabling polling in nodemon:

nodemon -L server.js
In WebStorm the full command that ends up getting used is

docker-compose run dev node node_packages/nodemon/bin/nodemon.js -L server.js
More info: GitHub - remy/nodemon: Monitor for any changes in your node.js application and automatically restart the server - perfect for development

you mean it is not supported when we mount data from host, ?

is there any other way i didn’t have any nodemon: , it is on linux