一、上传docker包
wget -c https://download.docker.com/linux/static/stable/x86_64/docker-20.10.17.tgz
二、解压docker包
tar -xvf ./docker-20.10.17.tgz
三、将docker相关程序文件拷贝到`/usr/bin`目录
cp ./docker/* /usr/bin/
四、新建/etc/docker目录
mkdir -p /etc/docker
五、配置docker配置文件
里面的镜像加速包需要自己添加(可能会失效导致不能拉取包)
vim /etc/docker/daemon.json
{
"bip": "10.233.0.1/22",
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://mirrors.tuna.tsinghua.edu.cn",
"http://mirrors.sohu.com",
"https://ustc-edu-cn.mirror.aliyuncs.com",
"https://ccr.ccs.tencentyun.com",
"https://docker.m.daocloud.io",
"https://docker.awsl9527.cn"
]
}
六、配置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 --selinux-enabled=false
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
七、启动docker
systemctl daemon-reload
systemctl start docker
systemctl enable docker
八、验证
systemctl status docker
docker ps
docker --version