标签:systemd enable 官方 doc http reload ali cgroup nat
tar zxvf docker-19.03.9.tgz
mv docker/* /usr/bin
添加systemctl启动
cat > /usr/lib/systemd/system/docker.service << EOF
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
EOF
#############################
创建配置文件,添加镜像源
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-‘EOF‘
{
"registry-mirrors": ["https://ajvcw8qn.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
重新加载,启动。设置开机自启
systemctl daemon-reload
systemctl restart docker
systemctl enable docker.service
标签:systemd enable 官方 doc http reload ali cgroup nat
原文地址:https://www.cnblogs.com/zhaichao93/p/14074457.html