To provide a more specific answer than the others.
The reboot works because the source of this issue is missing kernel module files for your active kernel.
Say you're running kernel linux-image-4.19.0-13-amd64
. This package installs the various binary kernel module files under /lib/modules/4.19.0-13-amd64
. When you load up a Docker container, it loads several of these modules dynamically, especially if this is the first container you've started since last boot.
Now let's say you upgrade your kernel to linux-image-4.19.0-14-amd64
. At this point, pending a reboot, you're still running linux-image-4.19.0-13-amd64
and if you start a Docker container, it will load the 4.19.0-13
modules. This should work fine.
The issue comes if you then remove the linux-image-4.19.0-13-amd64
package before rebooting (and ignore the dire warning about "removing a running kernel" as I am apt to do). If you then try to load these modules, it will fail because the binary files in /lib/modules
for the running kernel are now missing. This is why a reboot fixes it - on reboot, you boot into the newer kernel that has these files for it.
Hopefully this helps clarify, as I just ran into the issue myself and needed to figure it out rather than reboot the system.
sudo apt install linux-modules-extra-raspi