下载解压 Docker rpm 并离线安装
cd /tmp/
curl -O http://pan.kuaicdn.cn:800/%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F/docker/docker-ce-20.10.5.tar.gz
tar zxvf docker-ce-20.10.5.tar.gz
rm -rf /etc/yum.repos.d/docker-ce.repo
yum localinstall /tmp/docker-ce/*.rpm -y
配置并启动 Docker
usermod -aG docker root
mkdir -p /etc/docker
cat >/etc/docker/daemon.json <<EOF
{
"registry-mirrors": [
"https://bn4ll166.mirror.aliyuncs.com"
],
"data-root": "/data/docker-root",
"dns": [
"223.5.5.5",
"119.29.29.29"
],
"bip": "172.31.255.254/16",
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
],
"userland-proxy": false,
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "1"
}
}
EOF
systemctl daemon-reload
systemctl enable docker
systemctl restart docker