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.

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