如何在docker容器上设置ulimit / file描述符,图像标签是phusion / baseimage-docker [英] how to set ulimit / file descriptor on docker container the image tag is phusion/baseimage-docker

查看:936
本文介绍了如何在docker容器上设置ulimit / file描述符,图像标签是phusion / baseimage-docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在docker容器上正确设置文件描述符限制
i使用ssh连接到容器

i need to set the file descriptor limit correctly on the docker container i connect to container with ssh

https://github.com/phusion/baseimage-docker

ALREADY TRIED:


  • 编辑limits.conf容器忽略此文件

  • edit limits.conf the container ignore this file

https://coderwall.com/p/myodcq但是这个docker图像

upstart procedure found at https://coderwall.com/p/myodcq but this docker image

具有不同类型的init进程。 (runit)

has different kind of init process. (runit)


  • 我尝试修改/etc/pam.d

  • i tried to modify configuration of pam library in /etc/pam.d

尝试在sshd_config中启用sam的pam

try to enabled pam for ssh in sshd_config

输出它总是一样。

bash:ulimit:打开文件:无法修改限制:不允许操作

谢谢

推荐答案

最新的docker支持通过命令行和API设置ulimits。例如, docker run take - ulimit< type> =< soft>:< hard> 可以有许多你喜欢的。所以,对于你的nofile,一个例子是 - ulimit nofile = 262144:262144

The latest docker supports setting ulimits through the command line and the API. For instance, docker run takes --ulimit <type>=<soft>:<hard> and there can be as many of these as you like. So, for your nofile, an example would be --ulimit nofile=262144:262144

这篇关于如何在docker容器上设置ulimit / file描述符,图像标签是phusion / baseimage-docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆