Interview Prep/Docker/Resources, health checks, logging and restarts

Limits seem ignored: `WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.`

AdvancedTroubleshootingResources, health checks, logging and restarts
Answer

Likely causes → Swap accounting disabled in the kernel (common on Debian/Ubuntu defaults).

Diagnose → docker info | grep -i swap; cat /proc/cmdline.

Fix → Add cgroup_enable=memory swapaccount=1 to GRUB (cgroup v1), or use cgroup v2 where it works; update-grub and reboot.

Prevent → Standardise kernel parameters in the host image.

All Docker questions Roadmap: Docker & containers

More on Resources, health checks, logging and restarts