I run a linux container on oraclelinux 9 linux host (the host itself runs in a VM).
From where does docker read the sysctl params?
I try change the default value of a sysctl value which docker uses.
For that I executed the following steps on the host
-
sysctl -w net.ip4.udp_rmem_min=64000000
- sysctl -a | grep ip4.udp_rmem_min
-> 64000000
- systemctl restart docker
(just to be save)
- docker run --rm -it oraclelinux:9
in container
- sysctl -a | grep ip4.udp_rmem_min
-> 4096
Why is it 4096 and not 64000000?
cat /proc/sys/net/ipv4/udp_rmem_min
on the host does return 64000000
I also copied a file containing the parameters to /etc/sysctl.d/
and rebooted the machine, same result.
Interestingly when I do the same on a Ubuntu 22 machine (bare metal), it works.
So from where does docker read the sysctl values in oraclelinux 9/rhel?
I assumed it just uses the one from the host or do I have some other issues?
I know I could use --sysctl
with docker run
, but I can't use it like that because I use docker indirectly through kind
which doesn't seem to provide any possibility to define --sysctl
Asked by Arikael
(185 rep)
Apr 5, 2024, 07:58 AM