If I do this on the HostOS, everything is fine, our application works as intended.
Unfortunately, after a reboot, this setting is lost.
How can I set this fleet-wide so that it persists across reboots and any updates?
I have tried the following already:
RUN sysctl -w net.core.rmem_max=67108864
RUN sysctl -w net.core.rmem_default=67108864
in my Dockerfile
alongside both commands also in the CMD section, right before starting my main application.
In the docker-compose.yml the container has: privileged: true.
Even tried with: sysctls entries in docker-compose.yml … No luck :-/
I’m setting these in a start-up script inside my container (not in the Dockerfile) and it works fine. I don’t think you can set kernel parameters (like these) in the Dockerfile as they aren’t stored in the file system where docker detects them and they become part of the overlay.
Hi @HakanL
thanks, I also tried that but I’m getting: sysctl: cannot stat /proc/sys/net/core/rmem_max: No such file or directory
As stated above: the container has privileged: true in the docker-compose.yml.
I only see these settings:
I’m running single container, but that shouldn’t matter, these kernel settings should be available in any of your containers. Here’s my output from inside the container, but I get the same result if I do it on the host OS:
Found the issue, I’ve now also added the label io.resin.features.procfs: '1' and also was able to enable network_mode: host on our environment. Now I can set it.
Thanks!
Cool that you figured it out. I can’t remember why/when I set the procfs, I may have just copied it from a template. The network mode makes sense for my application, but I’m a little surprised it was required, but maybe it is so you’re manipulating the actual network interface, and not a virtual interface.