ProSheet 05 of 11
The rest of this sheet is locked7 Pro sheets unlock together, across every toolEveryPro sheet, every toolLifetimeone payment, no renewalNewsheets included as they shipOne-time payment · lifetime access
Managing Container Lifecycle
A comprehensive developer cheatsheet covering Docker container monitoring and administration, featuring essential CLI commands and operational workflows for updating resource limits, inspecting container details, tracking live resource stats, streaming daemon events, and pruning stopped containers.
docker update — Update Container Configuration
Updates container resource limits (CPU, memory) at runtime.
Basic Usage
bash
$ docker update --memory=512m --cpus=1 web-server
web-serverCommon Flags
| Flag | Purpose |
|---|---|
--cpus | CPU limit (e.g., 0.5, 1, 2) |
--memory | Memory limit (e.g., 512m, 1g) |
--memory-swap | Swap memory limit |
--restart | Restart policy |
--cpu-period | CPU CFS period |
--cpu-quota | CPU CFS quota |
Examples
Update memory limit:
bash
$ docker update --memory=1g web-serverUpdate CPU limit:
bash
$ docker update --cpus=0.5 web-serverUpdate restart policy:
bash
$ docker update --restart=always web-serverUpdate multiple containers:
bash
$ docker update --memory=512m web-server app-container