0

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

2
  • A container runs in its own network namespace, which means it has its own copy of the net sysctls. You can set sysctl values in your Kubernetes pods, see the documentation. Commented Apr 5, 2024 at 12:14
  • but why does it seem to take the net sysctl values in case of the Ubuntu host and not when using OracleLinux? Commented Apr 8, 2024 at 6:11

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.