Skip to main content
RunBook Academy

Docker & ContainersXXX Β· Host MaintenanceKernel

Kernel updates β€” what every container inherits from the host

Intermediate⏱ ~22 mindocker

What you'll learn

  • Name the kernel subsystems every container depends on
  • Distinguish an installed kernel from a running one
  • Use `needrestart` to find what a patch run left stale
  • Judge what live kernel patching covers and what it does not

Prerequisites

Verified against Docker Engine 29.x Β· Docker Engine 28.x Β· Docker Compose 2.x Β· containerd 2.x Β· runc 1.2.x Β· BuildKit 0.20+ Β· Linux kernel 5.15+ Β· Ubuntu 24.04 LTS Β· Debian 12 (Bookworm) Β· 2026-08-11

Not yet marked complete on this device.

A virtual machine has its own kernel, so patching the hypervisor’s kernel and patching the guest are independent operations. A container does not. Every container on a Docker host is executing syscalls against the host’s single kernel, and the entire isolation model is kernel features.

That makes the host kernel simultaneously the most security-relevant component on the machine and the one that cannot be updated without stopping everything.

What the containers are using

Read-only / Safeone kernel
$ docker run --rm alpine:3.20 uname -r
6.8.0-51-generic

Illustrative output

Compare that with uname -r on the host and they are identical, always. The image’s own distribution version is irrelevant to this: an Ubuntu 20.04 container on a host running a 6.8 kernel is using 6.8.

Every one of these is a kernel feature the container depends on:

FeatureWhat breaks without it
Namespaces (pid, net, mnt, uts, ipc, user)Isolation itself
cgroups v2Every resource limit
overlayfsThe storage driver, and therefore every image
seccomp (BPF)The syscall filter applied at container start
AppArmor / SELinux (LSM)The mandatory access control profile
veth, bridge, netfilter/nftablesAll container networking and port publishing

A kernel with any of these misconfigured or missing is a host on which Docker either refuses to start containers or starts them with less isolation than you think.

Installed is not running

The distinction that makes kernel patching reporting so misleading:

Read-only / Saferunning vs installed
# What is actually executing right now
uname -r

# Every kernel image installed
dpkg -l 'linux-image-*' | awk '/^ii/ {print $2, $3}'

# Ubuntu and Debian drop this file when a reboot is needed
ls -l /var/run/reboot-required /var/run/reboot-required.pkgs 2>/dev/null
cat /var/run/reboot-required.pkgs 2>/dev/null
Read-only / Safea host that needs a reboot
$ uname -r; cat /var/run/reboot-required.pkgs
6.8.0-51-generic
linux-image-6.8.0-52-generic
linux-base

Illustrative output

An automatic patching job that installs kernels without rebooting produces exactly this state, indefinitely. The package database says the host is fully patched. The running kernel is whatever it booted with, possibly months ago.

Read-only / Safestaleness audit
# Report only; restarts nothing
sudo needrestart -r l

# Kernel only, batch output for monitoring
sudo needrestart -k -b

Live patching, and its limits

Ubuntu Livepatch and kpatch apply certain kernel fixes to a running kernel without a reboot. On a Docker host this is genuinely valuable, because the alternative is stopping every container.

It is not a replacement for rebooting.

CoveredNot covered
Selected high and critical severity kernel CVEsMost kernel updates
Fixes expressible as a function replacementData structure or ABI changes
The currently running kernel versionMoving to a newer kernel version

Kernel changes that break Docker

Rare, but worth knowing the shape of:

  • Booting an older kernel from the GRUB menu to work around something, on a host whose Docker installation needs a feature the older kernel lacks. cgroup v2 is the usual casualty and the daemon may fall back to v1 with different limit semantics.
  • A cgroup v1 to v2 transition, whether from a distribution upgrade or a systemd.unified_cgroup_hierarchy kernel parameter. Resource limits are expressed differently between the two and the daemon reports the mode in docker info.
  • A storage driver whose prerequisites the new kernel no longer satisfies. Almost never on overlay2; more plausible on btrfs or zfs where the module must match the kernel.
Read-only / Safepost-reboot kernel check
uname -r
docker info --format 'cgroup={{.CgroupVersion}} driver={{.CgroupDriver}} storage={{.Driver}}'
docker info 2>&1 | grep -iE 'warning|no swap|no cpu' || echo 'no daemon warnings'

docker info prints warnings for missing kernel capabilities β€” the classic being WARNING: No swap limit support on a host booted without swapaccount=1. A warning that appears after a kernel change and was not there before is the fastest signal that the reboot changed something.

Knowledge check

Knowledge check Β· 4 questions

  1. Q1. You run `uname -r` inside an Ubuntu 20.04 container on a host running kernel 6.8. What does it report?

  2. Q2. A patch run installed a newer kernel package. What does `/var/run/reboot-required` tell you?

  3. Q3. Which kernel subsystems does every Docker container depend on? Select all that apply.

  4. Q4. Live kernel patching covers only selected high-severity fixes and does not move the host to a newer kernel version, so a scheduled reboot is still required.

Passing score: 75%. Answers are checked in this browser.