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

  • celery won't connect to rabbitmq broker for kubernetes
  • Ran out of Docker disk space
  • How do I write a dockerfile to execute a simple bash script?
  • docker service update: “image could not be accessed on a registry to record it's digest”
  • Docker: MacOSX Expose Container ports to host machine
  • Removing a file from a docker container
  • 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?

  • StartSSL SSL certificate showing up as net::ERR_CERT_AUTHORITY_INVALID in browser
  • docker nginx connection refused while connecting to upstream
  • empty PATH returned when entering new Docker image
  • Can I use mem_limit in docker-compose? and How?
  • How do I use a volume created by the docker volume command?
  • How to start a docker container when windows boots
  • One Solution collect form web for “In docker run, how to set multi-value in –ulimit”

    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
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.