CPU Limit (--cpus)
DK · Run Optionssyntax
docker run --cpus <number> <image>example
docker run -d --cpus 1.5 --name worker myapp:1.0
docker run -d --cpus 0.5 --name background-job myapp:1.0Note The value represents CPU cores (1.5 means one and a half cores). This is a soft limit via CFS scheduling, not a hard reservation. The container can still burst briefly if the host is idle.