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

  • Resolving env inside another env
  • Having problems deploying an go app to docker
  • Docker-compose mongoose
  • Docker: what is the equivalent of the legacy --link parameter
  • fastcgi-mono-server4 and nginx with docker
  • How to create a customizable environment that can be rapidly distributed to a local machine?
  • 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?

  • Docker complaining about ALL_PROXY environment variable with “proxy: unknown scheme: http”
  • What is the correct way to have Tensorflow available in a docker container or docker image?
  • Docker Image Entry Point Script Not Found
  • Docker Remote API JSON schema definition
  • Spring Cloud Samples Eureka - Docker - Use of underscore in link
  • In Docker, why is it recommended to run `apt-get` update in the Dockerfile?
  • 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.