添加 service/docker.sevice
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Docker Application Container Engine
|
||||||
|
Documentation=https://docs.docker.com
|
||||||
|
After=network-online.target nss-lookup.target docker.socket firewalld.service containerd.service time-set.target
|
||||||
|
Wants=network-online.target containerd.service
|
||||||
|
Requires=docker.socket
|
||||||
|
StartLimitBurst=3
|
||||||
|
StartLimitIntervalSec=60
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
# the default is not to use systemd for cgroups because the delegate issues still
|
||||||
|
# exists and systemd currently does not support the cgroup feature set required
|
||||||
|
# for containers run by docker
|
||||||
|
ExecStart=/usr/local/bin/dockerd
|
||||||
|
ExecReload=/bin/kill -s HUP $MAINPID
|
||||||
|
TimeoutStartSec=0
|
||||||
|
RestartSec=2
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
||||||
|
# in the kernel. We recommend using cgroups to do container-local accounting.
|
||||||
|
LimitNPROC=infinity
|
||||||
|
LimitCORE=infinity
|
||||||
|
|
||||||
|
# Comment TasksMax if your systemd version does not support it.
|
||||||
|
# Only systemd 226 and above support this option.
|
||||||
|
TasksMax=infinity
|
||||||
|
|
||||||
|
# set delegate yes so that systemd does not reset the cgroups of docker containers
|
||||||
|
Delegate=yes
|
||||||
|
|
||||||
|
# kill only the docker process, not all processes in the cgroup
|
||||||
|
KillMode=process
|
||||||
|
OOMScoreAdjust=-500
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user