the daemon should start the containers with the option that makes them not restart while apt-get is happening
also: how to run apt-get upgrade on the host? that should be possible with the ... ns... (namespace)....? option?
docker run --rm \
--privileged \
--pid=host \
alpine:latest \
nsenter -t 1 -m -u -n -i -- \
apt-get update && apt-get upgrade -y
and/or
docker run --rm -it --privileged --pid=host alpine:latest \
nsenter -t 1 -m -u -n -i \
systemd-run --unit=host-update --description="Docker-safe Upgrade" \
--no-block \
bash -c "apt-get update && apt-get upgrade -y"
also
apt-mark hold docker-ce docker-ce-cli containerd.io