I am trying to change inotify.max_user_instances setting for docker env on the level of Dockerfile. I am trying to do it because I am receiving this error:
Application startup exception: System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached.
I already use:
.AddJsonFile($"appsettings.json", optional: true, reloadOnChange: false);
I as well tried to use custom "WebHost.CreateDefaultBuilder(args)", because it was pointed out that it uses reloadOnChange: true with the same file.
Tried as well running in dockerfile:
RUN sysctl -w fs.inotify.max_user_watches=1048576
RUN echo fs.inotify.max_user_watches=1048576 | tee -a /etc/sysctl.conf && sysctl -p
But it was pointed out that it is impossible to run from that context.
Is there possibility to change those sysctl settings from the stage of docker image build/deployment? I am a little lost in this.
If it helps, application is using .net core 2.2