Skip to content

Commit 22f15d4

Browse files
mihaothaJeztah
authored andcommitted
Do not "Bind" docker "To" containerd.
relates to docker/for-linux#678 When using the BindTo directive, Docker is permanently stopped by systemd when containerd is temporarily killed and restarted; Using `Requires` achieves mostly the same, but defines a weaker dependency; https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires= > Requires= > > .. If this unit gets activated, the units listed will be activated as well. > If one of the other units fails to activate, and an ordering dependency > After= on the failing unit is set, this unit will not be started. Besides, > with or without specifying After=, this unit will be stopped if one of the > other units is explicitly stopped. We may want to look into using `Wants=` instead of `Requires=`, because that allows docker to continue running if containerd is restarted, quoting the systemd documentation: > Often, it is a better choice to use Wants= instead of Requires= in order > to achieve a system that is more robust when dealing with failing services. Given that docker will likely still fail if the containerd socket is not present, startup will fail if containerd is not running, but if containerd is restarted, the docker daemon may be able to try reconnecting. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 57ae892 commit 22f15d4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

systemd/docker.service

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[Unit]
22
Description=Docker Application Container Engine
33
Documentation=https://docs.docker.com
4-
BindsTo=containerd.service
54
After=network-online.target firewalld.service containerd.service multi-user.target
65
Wants=network-online.target
7-
Requires=docker.socket
6+
Requires=docker.socket containerd.service
87

98
[Service]
109
Type=notify

0 commit comments

Comments
 (0)