sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
碰到需要选择yes的都选yes
安装yum-utils包目的是为了提供yum-config-manager工具,来设置docker的稳定仓库。
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
同样,能选yes的也选y
sudo yum install docker-ce docker-ce-cli containerd.io
yum list docker-ce --showduplicates | sort -r
sudo yum install docker-ce-20.10.5 docker-ce-cli-20.10.5 containerd.io
sudo systemctl start docker
docker version
sudo docker run hello-world
原文:https://www.cnblogs.com/JerryMouseLi/p/14491981.html