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=https://yum.dockerproject.org/gpg
---------------------------分割线---------------------------
yum install docker-engine
service docker start
ok,启动成功
CentOs7安装与CentOs6差不多,
有个答案是先移除安装的和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
---------------------------分割线---------------------------
yum install docker-engine
service docker start
但是会报这样的错
[[email protected] ~]# service docker start
Redirecting to /bin/systemctl start docker.service
Job 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=https://yum.dockerproject.org/gpg
---------------------------分割线---------------------------
yum install docker-engine
service docker start
原文地址:https://www.cnblogs.com/java-jiangtao-home/p/10832250.html