(1)卸载旧版本docker
yum remove docker docker-common container-selinux docker-selinux docker-engine
(2)更新yum
yum update
(3)下载utils
yum install yum-utils
(4)添加阿里源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
(5)更新索引
yum makecache fast
yum makecache
(6)centos8需要先安装依赖包,centos7的直接跳过第六步,安装docker
wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
yum -y install containerd.io-1.2.6-3.3.el7.x86_64.rpm
(7)安装docker
yum install docker
(8)启动docker
systemctl start docker
(9)查看docker下的景象,正常情况下应该是这样子啥都没有