h22q
h22q

Reputation: 3

In docker run, how to set multi-value in --ulimit

$ sudo docker run --ulimit fsize=10240 cpu=12 -it ubuntu /bin/bash docker: Error parsing reference: "cpu=12" is not a valid repository/tag. See 'docker run --help'.

$ sudo docker run --ulimit fsize=10240 --ulimit cpu=12 -it ubuntu /bin/bash root@ea4b00375adf:/# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) 10 pending signals (-i) 5903 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 524288 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) 12 max user processes (-u) 524288 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited

I want to set multi-value in --ulimit,

seems --ulimit fsize=10240 --ulimit cpu=12 works well,

but --ulimit fsize=10240 cpu=12 doesn't work,

is there any format I can use with only one --ulimit?

Upvotes: 0

Views: 1621

Answers (1)

Vitor Nascimento
Vitor Nascimento

Reputation: 107

Note that the ulimit tool shows blocks and not bytes.

Try:

sudo docker run --ulimit fsize=2048 --ulimit cpu=12 -it ubuntu /bin/bash 

ulimit -a

file size               (blocks, -f) 2

Upvotes: 1

Related Questions