CentOs6和Centos7安装docker

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

但是会报这样的错

[root@localhost ~]# 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

 

 

 

 

 

 

上一篇:inotify和rsync实现实时同步


下一篇:django修改模型后更新数据库