Open madankumark opened 6 years ago
Hi @madankumark;
I use this kind of config for different containers and cpushares
and pids-limits
works at least with: Docker version 18.06.1-ce
CONTAINER=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd | rev | cut -d/ -f 1 | rev) CPUS=100 # 1024 = 100% IMAGE= MEM=16M PIDS=100 RESTART=unless-stopped
[[ -f .env ]] && \ source .env
[[ -z $DATA ]] && \ DATA=$CONTAINER
docker stop $CONTAINER docker rm $CONTAINER docker pull $IMAGE
docker run -d \ -e PGID=$PGID \ -e PUID=$PUID \ -e TZ=$TZ \ --cpu-shares=$CPUS \ --memory $MEM \ --name $CONTAINER \ $NETWORK \ --pids-limit=$PIDS \ --restart $RESTART \ --security-opt no-new-privileges \ -v $DATA:/config \ $IMAGE
docker run --help|grep pid
--pid string PID namespace to use
--pids-limit int Tune container pids limit (set -1 for unlimited)
what make you suspicious ? did it trow you an error ? which kind of test are you making to say it's not working ?
What about the PR as seen in the moby project, which got already merged? https://github.com/moby/moby/pull/32519
Expected behavior
We have --pids-limit and --ulimit in docker container create/run in order to control the resource usage for a container. However these options are missing from docker update command. This feature will be helpful for upgrading the existing containers based on usage.
Output of
docker version
: