Description: Order docker.service after containerd.service
 Fixes proper shutdown of containers.
Origin: upstream, cherry-picked parts of https://github.com/moby/moby/pull/42373
 and https://github.com/moby/moby/pull/42622
Bug-Debian: https://bugs.debian.org/989490

Index: docker/engine/contrib/init/systemd/docker.service
===================================================================
--- docker.orig/engine/contrib/init/systemd/docker.service
+++ docker/engine/contrib/init/systemd/docker.service
@@ -1,8 +1,8 @@
 [Unit]
 Description=Docker Application Container Engine
 Documentation=https://docs.docker.com
-After=network-online.target docker.socket firewalld.service
-Wants=network-online.target
+After=network-online.target docker.socket firewalld.service containerd.service
+Wants=network-online.target containerd.service
 Requires=docker.socket
 
 [Service]
@@ -11,7 +11,7 @@ Type=notify
 # exists and systemd currently does not support the cgroup feature set required
 # for containers run by docker
 EnvironmentFile=-/etc/default/docker
-ExecStart=/usr/sbin/dockerd -H fd:// $DOCKER_OPTS
+ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $DOCKER_OPTS
 ExecReload=/bin/kill -s HUP $MAINPID
 LimitNOFILE=1048576
 # Having non-zero Limit*s causes performance problems due to accounting overhead
