Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

linux - /proc/sys/net/ipv4/ip_local_reserved_ports missing from amd64/centos:7 docker container running on RedHat Centos 7

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...