Centos6安装的时候是按照网上的步骤,
yum install -y epel-release
yum install -y docker -io
service docker start
失败了,说是未被识别的服务,接下来
yum remove docker
yum remove docker-io
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=
---------------------------分割线---------------------------
yum install docker-engine
service docker start
ok,启动成功
CentOs7安装与CentOs6差不多,
有个答案是先移除安装的和docker相关的东西
yum remove docker
yum remove docker-selinuxvi /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=
---------------------------分割线---------------------------
yum install docker-engine
service docker start
但是会报这样的错
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.serviceJob for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details我感觉应该是没有卸载干净,我是把虚拟机删除重新导入,按照上面的方式安装成功(如下):
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=
---------------------------分割线---------------------------
yum install docker-engine
service docker start