I want to set unlimited core file size with ulimit inside docker. I can't do this by

ulimit -c unlimited

because parameters for docker are set by framework, that doesn't accept unlimited parameter. So I need to set it by passing direct value. I found that 9223372036854775807 is the max value, but when I set it, I get:

ulimit: 9223372036854775807: limit out of range

How can I find max value which I can pass to ulimit -c ?

2 Answers 2


On Linux, the RLIMIT_CORE limit (see setrlimit(2) man page), is expressed in bytes. While for the ulimit of bash and most other shells, it's expressed in kibibytes.

The max value for RLIMIT_CORE in bytes that you can pass to setrlimit() on Linux will be the largest unsigned 64 bit integer (18446744073709551615), bearing in mind that it is actually the special value for RLIM_INFINITY, the max that you can pass to bash's ulimit will be that divided by 1024, 18014398509481983, but then, that will not set the limit to RLIMIT_INFINITY as 18014398509481983 * 1024 is 18446744073709550592 which is 1023 short of RLIM_INFINITY.


You can set the limits on the container on Docker run with the --ulimit flag.

docker run --ulimit core=<size> ...

Note that "unlimited" is not a supported value since it is not actually a real value, but -1 is equivalent to it:

$ docker run -it --ulimit core=-1 ubuntu:18.04 sh -c 'ulimit -a | grep core'
coredump(blocks)     unlimited

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.