docker-update
dynamically update container resource limits
TLDR
Update CPU limit
$ docker update --cpus [2] [container]
Update memory limit$ docker update --memory [512m] [container]
Update restart policy$ docker update --restart [always] [container]
Update multiple containers$ docker update --memory [1g] [container1] [container2]
Remove memory limit$ docker update --memory [0] [container]
SYNOPSIS
docker update [options] container [container...]
DESCRIPTION
docker update dynamically updates container resource constraints. Allows changing CPU, memory, and restart settings without recreating the container. Can update running or stopped containers. Not supported for Windows containers.
PARAMETERS
--cpus decimal
Number of CPUs.--memory, -m bytes
Memory limit.--memory-swap bytes
Swap limit (-1 for unlimited).--restart string
Restart policy (no, on-failure, always, unless-stopped).--cpu-shares int
CPU shares (relative weight).--memory-reservation bytes
Memory soft limit.--cpuset-cpus string
CPUs in which to allow execution (e.g., 0-3, 0,1).--pids-limit int
Tune container pids limit (-1 for unlimited).--blkio-weight uint16
Block IO relative weight (10-1000), 0 to disable.--cpu-period int
Limit CPU CFS period (microseconds).--cpu-quota int
Limit CPU CFS quota (microseconds).
CAVEATS
The --kernel-memory option has been deprecated since Docker 20.10. Memory changes on running containers may require a restart to take full effect on some systems.
SEE ALSO
docker(1), docker-container-update(1), docker-run(1), docker-inspect(1)
