Change ulimit in Docker Container
Any opportunity to change the ulimit value in the docker container.
I pull the docker image in the center and run the container from it. But I couldn't increase the ulimit value inside the container. It shows "Operation not allowed".
Yes, I know docker doesn't have permission to do this. Searching on google, they reported options run --ulimit
when deploying docker container. But that doesn't work for me.
docker run -d --ulimit nofile=8000:16000 * --expose=80 --expose=443 centos:centos6 nginx -g 'daemon off;'
flag provided but not defined: --ulimit
See 'docker run --help'.
Can anyone help me?
source to share
The option --ulimit
was added in docker 1.6 (see the linked pull request here: https://github.com/docker/docker/pull/9437 ).
I am using an older docker version, you will not be able to use this function, in which case you have to upgrade to the current docker version
source to share
As you can see in commit 3f39050 , the ulimit option is one introduced in Docker 1.6.0+.
If the option is not recognized, it might be because the docker version does not return 1.60+.
source to share