dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
dnf install -y yum-utils device-mapper-persistent-data lvm2
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sed -i 's+https://download.docker.com+https://mirror.nju.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
dnf makecache
dnf install -y docker-ce
systemctl enable --now docker
ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose
https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/
- 在配置文件
/etc/docker/daemon.json
中加入
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": [
"https://docker.chenby.cn/"
]
}
EOF
https://mirrors.nju.edu.cn/help/docker-hub
https://mirrors.ustc.edu.cn/help/dockerhub.html