The software described in this documentation is either no longer supported or is in extended support.
Oracle recommends that you upgrade to a current supported release.

4.16 Setting ulimit Values on Containers

The --ulimit option to docker run allows you to specify ulimit values for a container, for example:

$ docker run -i -t --rm myapp:2.0 --ulimit nofile=128:256 --ulimit nproc=32:64

This example sets a soft limit of 128 open files and 32 child processes and a hard limit of 256 open files and 64 child processes on the container.

From version 1.6.0 of Docker, you can set default ulimit values for all containers by specifying --default-ulimit options in the docker configuration file /etc/sysconfig/docker by appending the options to the OPTIONS line as follows:

OPTIONS="--ulimit nofile=1280:2560 --ulimit nproc=256:512"

Any ulimit values that you specify for a container override the default values that you set for the daemon.