I am confused with whether docker will inherit the host’s kernel parameter.I have do some tests as below:
The kernel version:
$ uname -r 3.10.0-957.el7.x86_64
- I want to echo the
ip_local_port_rangeparm and the command is :
$ sudo docker run --rm busybox cat /proc/sys/net/ipv4/ip_local_port_range
That is quite reasonable as
ip_local_port_range is a namespaced parameter and I guess it inherits from the host.
sudo docker run --rm busybox cat /proc/sys/net/ipv4/tcp_tw_reuse
cat: can't open '/proc/sys/net/ipv4/tcp_tw_reuse': No such file or directory
That is reasonable too, as far as I know, in kernel 3.10 the tcp_tw_reuse is not namespaced and the docker does not have that file.
Now, I would like to know is, as the ‘/proc/sys/net/ipv4/tcp_tw_reuse’ file is not present in the container, will the container inherit its value from the host. Any help will be appreciated.