New batchZero to DevOps starts 29 Nov · limited seatsReserve your seat
Cheat sheetsDockerDocker
ProSheet 05 of 11

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-server

Common Flags

FlagPurpose
--cpusCPU limit (e.g., 0.5, 1, 2)
--memoryMemory limit (e.g., 512m, 1g)
--memory-swapSwap memory limit
--restartRestart policy
--cpu-periodCPU CFS period
--cpu-quotaCPU CFS quota

Examples

Update memory limit:

bash
$ docker update --memory=1g web-server

Update CPU limit:

bash
$ docker update --cpus=0.5 web-server

Update restart policy:

bash
$ docker update --restart=always web-server

Update multiple containers:

bash
$ docker update --memory=512m web-server app-container

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