1、下载docker安装包
https://download.docker.com/linux/static/stable/x86_64
2、上传并解压安装文件
tar -zvxf docker-20.10.9.tgz
cp docker/* /usr/bin/
3、创建docker.service 文件
touch docker.service
将如下内容复制进
------------------------------------------------------------
[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
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
--------------------------------------------------------
给文件赋权
chmod+x /etc/systemd/system/docker.service
4、启动/开机启动
systemctl start docker / systemctl enable docker.service