Skip to content

Commit

Permalink
Fix Docker systemd service start/stop order
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chacal authored and tkurki committed May 28, 2019
1 parent 19dba91 commit 1592324
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/docker/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: "Reload systemd"
systemd:
daemon_reload: yes
9 changes: 9 additions & 0 deletions roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
path: /tmp/docker-install.sh
state: absent

# Fix Docker bug: add containerd as pre-requisite for Docker service, see: https://github.com/docker/for-linux/issues/421
- name: Start Docker after containerd
lineinfile:
dest: /lib/systemd/system/docker.service
regexp: "^After="
line: "After=network-online.target firewalld.service containerd.service"
notify: Reload systemd
become: true

- name: Set Docker to auto-start
service:
name: docker
Expand Down

0 comments on commit 1592324

Please sign in to comment.