Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我net.core.somaxconn = 65535在Ubuntu 映像内的/etc/sysctl.conf中设置。
net.core.somaxconn = 65535
但是使用 command 在容器中net.core.somaxconn变为128sysctl -a | grep net.core.somaxconn。
net.core.somaxconn
sysctl -a | grep net.core.somaxconn
我执行后sysctl -p,它变成了65535。
sysctl -p
为什么运行容器时 /etc/sysctl.conf不起作用(Docker 0.9)?</p>
这可能是因为 Docker 不sysctl为您运行。我不知道你如何启动你的容器,但如果你做类似的docker run -i -t image /bin/bash事情只会启动 bash。没有暴发户或任何东西,所以如果你认为跑步sysctl很重要,你需要自己做。
sysctl
docker run -i -t image /bin/bash
出于开发目的,您可以使用
docker run -i -t image sysctl -p && /bin/bash
对于生产用途,您可能需要查看主管或我的博客。