LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

docker-container-update

dynamically update container resource limits

TLDR

Update CPU limit
$ docker container update --cpus [2] [container]
copy
Update memory limit
$ docker container update --memory [512m] [container]
copy
Update restart policy
$ docker container update --restart [always] [container]
copy
Update multiple containers
$ docker container update --memory [1g] [container1] [container2]
copy

SYNOPSIS

docker container update [options] container [container...]

DESCRIPTION

docker container update dynamically updates resource constraints and restart policies for one or more running containers without requiring a restart. This allows administrators to adjust resource limits in response to changing workload requirements or to correct initial configuration mistakes.While most resource limit changes take effect immediately, some settings may require a container restart to fully apply. The restart policy update is particularly useful for changing whether containers should automatically restart on failure or system boot.

PARAMETERS

--cpus decimal

Number of CPUs.
--memory -m bytes
Memory limit.
--memory-swap bytes
Swap limit.
--restart policy
Restart policy (no, on-failure, always, unless-stopped).
--cpu-shares int
CPU shares (relative weight).
--cpu-period int
Limit CPU CFS (Completely Fair Scheduler) period.
--cpu-quota int
Limit CPU CFS quota.
--cpuset-cpus string
CPUs in which to allow execution (e.g., 0-3, 0,1).
--cpuset-mems string
MEMs in which to allow execution (0-3, 0,1).
--memory-reservation bytes
Memory soft limit.
--kernel-memory bytes
Kernel memory limit (deprecated).
--blkio-weight uint16
Block IO (relative weight), between 10 and 1000, or 0 to disable.
--pids-limit int
Tune container pids limit (set -1 for unlimited).

SEE ALSO

Copied to clipboard
Kai