You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.0 KiB

  1. [Unit]
  2. Description=Docker Application Container Engine
  3. Documentation=http://docs.docker.com
  4. {% if ansible_os_family == "RedHat" %}
  5. After=network.target {{ ' docker-storage-setup.service' if docker_container_storage_setup else '' }}{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  6. {{ 'BindsTo=containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  7. {{ 'Wants=docker-storage-setup.service' if docker_container_storage_setup else '' }}
  8. {% elif ansible_os_family == "Debian" %}
  9. After=network.target docker.socket{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  10. {{ 'BindsTo=containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  11. Wants=docker.socket
  12. {% elif ansible_os_family == "Suse" %}
  13. After=network.target lvm2-monitor.service SuSEfirewall2.service
  14. # After=network.target{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  15. # {{ 'BindsTo=containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  16. {% endif %}
  17. [Service]
  18. Type=notify
  19. {% if docker_storage_options is defined %}
  20. Environment="DOCKER_STORAGE_OPTIONS={{ docker_storage_options }}"
  21. {% endif %}
  22. Environment=GOTRACEBACK=crash
  23. ExecReload=/bin/kill -s HUP $MAINPID
  24. Delegate=yes
  25. KillMode=process
  26. ExecStart={{ docker_bin_dir }}/docker{% if installed_docker_version.stdout is version('17.03', '<') %} daemon{% else %}d{% endif %} \
  27. {% if ansible_os_family == "Suse" %}
  28. --add-runtime oci=/usr/sbin/docker-runc \
  29. {% endif %}
  30. $DOCKER_OPTS \
  31. $DOCKER_STORAGE_OPTIONS \
  32. $DOCKER_DNS_OPTIONS
  33. {% if not is_ostree and systemd_version.stdout|int >= 226 %}
  34. TasksMax=infinity
  35. {% endif %}
  36. LimitNOFILE=1048576
  37. LimitNPROC=1048576
  38. LimitCORE=infinity
  39. TimeoutStartSec=1min
  40. # restart the docker process if it exits prematurely
  41. Restart=on-failure
  42. StartLimitBurst=3
  43. StartLimitInterval=60s
  44. [Install]
  45. WantedBy=multi-user.target