系統:centos7系統。linux
輸入getenforce命令,查看selinux是打開仍是關閉docker
能夠看獲得selinux是關閉的,若是沒有關閉,輸入:vim
setenforce 0
a. cd /etc/yum.repos.d/centos
b.vim docker.repo將下面內容寫在這個文件裏面阿里雲
[dockerrepo] name=Docker Repository baseurl=http://mirrors.aliyun.com/docker-engine/yum/main/centos/$releasever/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.aliyun.com/docker-engine/yum/gpg
yum install -y docker-engine
service docker start chkconfig docker on
docker version
至此doker安裝成功。url