My Oracle Support Banner

How to set some kernel parameters as a pre-req in a docker container (Doc ID 2273973.1)

Last updated on AUGUST 04, 2018

Applies to:

Linux OS - Version Oracle Linux 7.2 and later
Information in this document applies to any platform.


The settings that should exist are:

1) Set rmem and wmem values

rmem_default 262144 /proc/sys/net/core/rmem_default
rmem_max 4194304 /proc/sys/net/core/rmem_max
wmem_default 262144 /proc/sys/net/core/wmem_default
wmem_max 1048576 /proc/sys/net/core/wmem_max

Trying to set these values results in below error.

# docker run -it --sysctl net.core.rmem_default="212992" oraclelinux:7 bash
docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:359: container init caused \\\"open /proc/sys/net/core/rmem_default: permission denied\\\"\"\n".

2) Unable to set sem value

Container is 32 even with higher in sysctl.conf
$ sysctl -a|grep "kernel\.sem"
kernel.sem = 250 32000 32 128
$ cat /etc/sysctl.conf|grep "kernel\.sem"
kernel.sem = 250 32000 250 128

3) Unable to set local port range

ip_local_port_range Should be 9000 65500
$ sysctl -a|grep local_port
net.ipv4.ip_local_port_range = 32768 61000
$ cat /etc/sysctl.conf|grep local_port
net.ipv4.ip_local_port_range = 9000 65500



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.