| 1 | [Unit] |
| 2 | Description=Docker Application Container Engine |
| 3 | Documentation=https://docs.docker.com |
| 4 | After=network-online.target nss-lookup.target docker.socket firewalld.service containerd.service time-set.target |
| 5 | Wants=network-online.target containerd.service |
| 6 | Requires=docker.socket |
| 7 | StartLimitBurst=3 |
| 8 | StartLimitIntervalSec=60 |
| 9 | |
| 10 | [Service] |
| 11 | Type=notify |
| 12 | # the default is not to use systemd for cgroups because the delegate issues still |
| 13 | # exists and systemd currently does not support the cgroup feature set required |
| 14 | # for containers run by docker |
| 15 | EnvironmentFile=-/etc/default/docker |
| 16 | ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $DOCKER_OPTS |
| 17 | ExecReload=/bin/kill -s HUP $MAINPID |
| 18 | TimeoutStartSec=0 |
| 19 | RestartSec=2 |
| 20 | Restart=always |
| 21 | |
| 22 | # Having non-zero Limit*s causes performance problems due to accounting overhead |
| 23 | # in the kernel. We recommend using cgroups to do container-local accounting. |
| 24 | LimitNPROC=infinity |
| 25 | LimitCORE=infinity |
| 26 | |
| 27 | # Comment TasksMax if your systemd version does not support it. |
| 28 | # Only systemd 226 and above support this option. |
| 29 | TasksMax=infinity |
| 30 | |
| 31 | # set delegate yes so that systemd does not reset the cgroups of docker containers |
| 32 | Delegate=yes |
| 33 | |
| 34 | # kill only the docker process, not all processes in the cgroup |
| 35 | KillMode=process |
| 36 | OOMScoreAdjust=-500 |
| 37 | |
| 38 | [Install] |
| 39 | WantedBy=multi-user.target |