Skip to content

Commit 782cf75

Browse files
committed
Fix Docker systemd service start/stop order
Docker should start after containerd and stop before it. See: docker/for-linux#421 Without fix shutting down Raspi takes many minutes and reboot fails completely.
1 parent 19dba91 commit 782cf75

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

roles/docker/handlers/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- name: "Reload systemd"
3+
systemd:
4+
daemon_reload: yes

roles/docker/tasks/main.yml

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
path: /tmp/docker-install.sh
1919
state: absent
2020

21+
# Fix Docker bug: add containerd as pre-requisite for Docker service, see: https://github.com/docker/for-linux/issues/421
22+
- name: Start Docker after containerd
23+
lineinfile:
24+
dest: /lib/systemd/system/docker.service
25+
regexp: "^After="
26+
line: "After=network-online.target firewalld.service containerd.service"
27+
notify: Reload systemd
28+
become: true
29+
2130
- name: Set Docker to auto-start
2231
service:
2332
name: docker

0 commit comments

Comments
 (0)