kubespray/roles/container-engine/docker/templates/docker.service.j2

42 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2016-01-09 17:45:50 +08:00
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket containerd.service lvm2-monitor.service SuSEfirewall2.service
{% if ansible_os_family != "Suse" %}
BindsTo=containerd.service
2016-01-09 17:45:50 +08:00
{% endif %}
Wants=docker.socket
2016-01-09 17:45:50 +08:00
[Service]
Type=notify
2016-12-08 00:18:41 +08:00
{% if docker_storage_options is defined %}
Environment="DOCKER_STORAGE_OPTIONS={{ docker_storage_options }}"
2016-12-08 00:18:41 +08:00
{% endif %}
2016-01-09 17:45:50 +08:00
Environment=GOTRACEBACK=crash
ExecReload=/bin/kill -s HUP $MAINPID
Delegate=yes
KillMode=process
ExecStart={{ docker_bin_dir }}/dockerd \
{% if ansible_os_family == "Suse" %}
--add-runtime oci=/usr/sbin/docker-runc \
{% endif %}
2016-11-05 05:40:14 +08:00
$DOCKER_OPTS \
2016-01-09 17:45:50 +08:00
$DOCKER_STORAGE_OPTIONS \
$DOCKER_DNS_OPTIONS
TasksMax=infinity
2016-01-09 17:45:50 +08:00
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=1min
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
# Set the cgroup slice of the service so that kube reserved takes effect
{% if kube_reserved is defined and kube_reserved|bool %}
Slice={{ kube_reserved_cgroups_for_service_slice }}
{% endif %}
2016-01-09 17:45:50 +08:00
[Install]
WantedBy=multi-user.target