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.

48 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', '>=') }}
  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', '>=') }}
  11. Wants=docker.socket
  12. {% elif ansible_os_family == "Suse" %}
  13. After=network.target{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }}
  14. {{ 'BindsTo=containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') }}
  15. {% endif %}
  16. [Service]
  17. Type=notify
  18. {% if docker_storage_options is defined %}
  19. Environment="DOCKER_STORAGE_OPTIONS={{ docker_storage_options }}"
  20. {% endif %}
  21. Environment=GOTRACEBACK=crash
  22. ExecReload=/bin/kill -s HUP $MAINPID
  23. Delegate=yes
  24. KillMode=process
  25. ExecStart={{ docker_bin_dir }}/docker{% if installed_docker_version.stdout is version('17.03', '<') %} daemon{% else %}d{% endif %} \
  26. {% if ansible_os_family == "Suse" %}
  27. --add-runtime oci=/usr/sbin/docker-runc \
  28. {% endif %}
  29. $DOCKER_OPTS \
  30. $DOCKER_STORAGE_OPTIONS \
  31. $DOCKER_NETWORK_OPTIONS \
  32. $DOCKER_DNS_OPTIONS \
  33. $INSECURE_REGISTRY
  34. {% if not is_atomic and systemd_version.stdout|int >= 226 %}
  35. TasksMax=infinity
  36. {% endif %}
  37. LimitNOFILE=1048576
  38. LimitNPROC=1048576
  39. LimitCORE=infinity
  40. TimeoutStartSec=1min
  41. # restart the docker process if it exits prematurely
  42. Restart=on-failure
  43. StartLimitBurst=3
  44. StartLimitInterval=60s
  45. [Install]
  46. WantedBy=multi-user.target