在docker run命令中更改ulimit值

时间:2017-07-18 11:13:41

标签: docker docker-compose

我尝试安装此图片......

...
warp prev stitched img into coordinates of img3 with h43
stitch warped stitched img with img3
warp prev stitched img into coordinates of img2 with h32
stitch warped stitched img with img2
warp prev stitched img into coordinates of img1 with h21
stitch warped stitched img with img1

并收到此错误:

# docker run -d -p 5601:5601 -p 5000:5000  -p 9200:9200 --ulimit 65536  kenwdelong/elk-docker:latest

如果删除ulimit选项,则会在容器日志中收到以下错误。

invalid argument "65536" for --ulimit: invalid ulimit argument: 65536
See 'docker run --help'.

根据谷歌,docker-compose.yml文件可以像这样有ulimit子句......

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

我不想使用docker-compose,但需要在run命令中使用该功能。

1 个答案:

答案 0 :(得分:4)

使用表格:docker run --ulimit <type>=<soft>:<hard>

因此,对于你的nofile,一个例子是--ulimit nofile=65536:65536

文档:

https://docs.docker.com/engine/reference/commandline/run/#set-ulimits-in-container-ulimit