温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centOS下使用yum install docker安装docker后启动不了的原因

发布时间:2021-08-24 17:56:30 来源:亿速云 阅读:273 作者:chen 栏目:互联网科技

本篇内容主要讲解“centOS下使用yum install docker安装docker后启动不了的原因”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“centOS下使用yum install docker安装docker后启动不了的原因”吧!

使用yum install docker安装完后启动不了

[root@apptest ~]# service docker start 

docker: unrecognized service

一直停留在以上步骤 可以使用以下命令来安装,即可成功。 一个问题让我折腾了两天,试过关闭防火墙,关闭selinux,重装系统,等等网上能查到的方法都解决不了。 如果大家解决了,回复感谢下我吧。

[root@apptest ~]# yum remove docker

[root@apptest ~]# yum remove docker-selinux

[root@test yum.repos.d]# 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

[root@test yum.repos.d]# yum install docker-engine

已安装: docker-engine.x86_64 0:1.10.2-1.el7.centos

作为依赖被安装: docker-engine-selinux.noarch 0:1.10.2-1.el7.centos

[root@apptest ~]# service docker start

Starting cgconfig service:                                 [  OK  ]
Starting docker:                                           [  OK  ]

[root@apptest ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE

[root@test yum.repos.d]# 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 Server: 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

[root@test yum.repos.d]# 或者使用以下方法

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

[root@apptest ~]# service docker start Redirecting to /bin/systemctl start docker.service

[root@apptest ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE

[root@apptest ~]#

官方网址可查 https://docs.docker.com/engine/installation/linux/centos/

到此,相信大家对“centOS下使用yum install docker安装docker后启动不了的原因”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI