Docker & ContainersXXX Β· Host MaintenanceKernel
Kernel updates β what every container inherits from the host
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
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
$ docker run --rm alpine:3.20 uname -r6.8.0-51-genericIllustrative 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:
| Feature | What breaks without it |
|---|---|
Namespaces (pid, net, mnt, uts, ipc, user) | Isolation itself |
| cgroups v2 | Every resource limit |
| overlayfs | The 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/nftables | All 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:
# 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$ uname -r; cat /var/run/reboot-required.pkgs6.8.0-51-generic
linux-image-6.8.0-52-generic
linux-baseIllustrative 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.
# Report only; restarts nothing
sudo needrestart -r l
# Kernel only, batch output for monitoring
sudo needrestart -k -bLive 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.
| Covered | Not covered |
|---|---|
| Selected high and critical severity kernel CVEs | Most kernel updates |
| Fixes expressible as a function replacement | Data structure or ABI changes |
| The currently running kernel version | Moving 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_hierarchykernel parameter. Resource limits are expressed differently between the two and the daemon reports the mode indocker 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.
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
Q1. You run `uname -r` inside an Ubuntu 20.04 container on a host running kernel 6.8. What does it report?
Q2. A patch run installed a newer kernel package. What does `/var/run/reboot-required` tell you?
Q3. Which kernel subsystems does every Docker container depend on? Select all that apply.
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.