1.首先安装docker:
如果以前安装过首先执行:
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
去卸载docker
2.安装dokcer需要的工具包
yum install -y yum-utils device-mapper-persistent-data lvm2
3.配置一下docker的仓库
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.配置一下阿里云的docker源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5.然后去安装docker
yum install docker-ce