Docker 错误:打开的文件太多

may*_*ree 7 docker

我在创建容器时收到该错误消息。

Error response from daemon: too many open files
Run Code Online (Sandbox Code Playgroud)

但是我找不到有关该错误的任何信息。(我看到了https://github.com/docker/libcontainer/issues/211,但这不是同一个问题。)有没有人知道它?

谢谢。

mty*_*urt 6

打开文件数的默认限制为 1024。您可以通过两种方式增加它:

  1. 使用--ulimit参数运行容器:

    docker run --ulimit nofile=5000:5000 <image-tag>
    
    Run Code Online (Sandbox Code Playgroud)
  2. 使用--privilegedmode运行容器并执行ulimit -n 5000.

您可以在此处找到更多信息。