如果之前安装过docker
yum remove docker
yum remove docker-selinux
然后
vi /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
如果有Error starting daemon: SELinux is not supported with the overlay2 graph driver on this 报错;
意思是:此linux的内核中的SELinux不支持 overlay2 graph driver ,解决方法有两个,要么启动一个新内核,要么就在docker里禁用selinux,–selinux-enabled=false
重新编辑docker配置文件:
vi /etc/sysconfig/docker
然后systemctl start docker 就好啦