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.

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