1.升级插件
sudo yum update -y
2.安装插件包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
3.添加源
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.查看源内的docker
sudo yum list docker-ce --showduplicates | sort -r
5.安装最稳定版docker
sudo yum install docker-ce
6. 卸载docker
sudo yum remove docker docker-common docker-selinux docker-engine
7. 检查是否安装成功
docker version
8. 设置开机启动
sudo systemctl start docker
sudo systemctl enable docker
网友评论