【亲测有效】centos安装完成docker后启动docker报错docker: unrecognized service的两种ag凯发k8国际的解决方案 -ag凯发k8国际
ag凯发k8国际
收集整理的这篇文章主要介绍了
【亲测有效】centos安装完成docker后启动docker报错docker: unrecognized service的两种ag凯发k8国际的解决方案
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
使用yum install docker安装完后启动不了,报错如下:
[root@sakura ~]#
docker: unrecognized service
一直停留在以上步骤,如果有遇到和我一样类似问题的小伙伴可以按照如下方法进行安装,即可安装成功~~
- 先移除docker
[root@sakura ~]#
yum remove docker再移除docker-selinux(如果你之前有安装过的话)
[root@sakura ~]#
yum remove docker-selinux然后修改文件
[root@sakura ~]#
vi /etc/yum.repos.d/docker.repo直接填入如下内容:
[dockerrepo]name=docker repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpg- 然后启动安装:
[root@sakura ~]#
yum install docker-engine作为依赖被安装: docker-engine-selinux.noarch 0:1.10.2-1.el7.centos
然后启动docker服务:
[root@sakura ~]#
service docker start返回如下状态码:
starting cgconfig service: [ ok ]
starting docker: [ ok ]
即可完美的使docker启动成功!!!
直接用这条命令安装
[root@sakura ~]#
curl -fssl https://get.docker.com/ | sh sh -c 'sleep 3; yum -y -q install docker-engine'可能会有以下提示信息,我们不需要去管:
警告:/var/cache/yum/x86_64/7/docker-main-repo/packages/docker-engine-selinux-1.10.2-1.el7.centos.noarch.rpm: 头v4 rsa/sha512 signature, 密钥 id 2c52609d: nokey docker-engine-selinux-1.10.2-1.el7.centos.noarch.rpm 的公钥尚未安装 导入 gpg key 0x2c52609d: 用户id : "docker release tool (releasedocker) " 指纹 : 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d 来自 : https://yum.dockerproject.org/gpg setsebool: selinux is disabled. sh -c 'docker version' client: version: 1.10.2 api version: 1.22 go version: go1.5.3 git commit: c3959b1 built: mon feb 22 16:16:33 2016 os/arch: linux/amd64 cannot connect to the docker daemon. is the docker daemon running on this host? if you would like to use docker as a non-root user, you should now consider adding your user to the "docker" group with something like: sudo usermod -ag docker your-user remember that you will have to log out and back in for this to take effect!然后直接启动就好了~~~
[root@sakura ~]#
service docker start redirecting to /bin/systemctl start docker.service总结
以上是ag凯发k8国际为你收集整理的【亲测有效】centos安装完成docker后启动docker报错docker: unrecognized service的两种ag凯发k8国际的解决方案的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇:
- 下一篇: