By default, containers can use unlimited host resources — which risks one container starving others or crashing the host. Docker lets you set resource limits (CPU, memory) to control consumption, important for stability and fair resource sharing in production.
The problem: unbounded resource use
BY DEFAULT a container can consume ALL available host CPU and memory:
→ a buggy/busy container (memory leak, runaway loop) can starve other containers
or crash the entire host (out of memory)
→ In production (multiple containers per host), LIMIT resources to isolate them.
