I've run into an issue with Docker and RedHat CentOs 7 while attempting to dockerize some rather old software. The steps to reproduce are:
docker pull amd64/centos:7
docker run -it --privileged amd64/centos:7 bash
[root@64e504118679 /]# echo "net.ipv4.ip_local_reserved_ports = 49001-49053" > /etc/sysctl.conf
[root@64e504118679 /]# sysctl -q -p
sysctl: cannot stat /proc/sys/net/ipv4/ip_local_reserved_ports: No such file or directory
I have verified that when running Docker on RedHat CentOS 7 (3.10.0-1127.19.1.el7.x86_64), the file does not exist in the container even though on the host machine it does. As far as I know, /proc
is mounted from the host filesystem and is specific to its Kernel, so the issue is probably either an incompatibility issue or bug with Docker and the RedHat Kernel. On both Ubuntu 19.04 and MacOS Catalina this works as expected.
Note that I am aware what I'm doing is probably not fully in line with Docker best practices, but this is indeed some quite old software that I'd rather not change as of yet.
question from:
https://stackoverflow.com/questions/65898358/proc-sys-net-ipv4-ip-local-reserved-ports-missing-from-amd64-centos7-docker-co 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…