Why did Docker get stopped on unattended upgrades
Ubuntu has a hidden auto-upgrade program, and it sometimes crashes your system by terminating docker. (My server went down for 5 hours because of this issue)
To fix this bug, just disable apt-daily-upgrade.timer.service
on all your ubuntu servers. Usually, even without this bug, we don't want slient upgrade which may cause service interruption.
sudo systemctl disable --now apt-daily-upgrade.timer
Ref: https://arun.nz/why-does-docker-restart-all-containers-regularly/
There is a bug in Ubuntu which caused this shutdown of dockerd. It occurred because of an automatic security update of containerd. See also https://serverfault.com/questions/1044493/how-to-make-sure-docker-service-will-start-after-containerd-upgrade.
The previously accepted answer disables the automatic security updates, so be aware of the consequences.