docker各版本下载地址
https://download.docker.com/linux/static/stable/
部署系统是centos7,我下载的安装包是:https://download.docker.com/linux/static/stable/x86_64/docker-20.10.17.tgz
解压tgz文件
tar xzvf docker-20.10.17.tgz
复制解压后的文件到/usr/bin
cp docker/* /usr/bin
在/usr/lib/systemd/system/下创建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
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
启动ocker服务
systemctl daemon-reload
systemctl start docker
systemctl enable docker