日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > centos >内容正文

centos

【亲测有效】Centos安装完成docker后启动docker报错docker: unrecognized service的两种解决方案

發布時間:2024/9/27 centos 337 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【亲测有效】Centos安装完成docker后启动docker报错docker: unrecognized service的两种解决方案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

使用yum install docker安裝完后啟動不了,報錯如下:
[root@Sakura ~]#

service docker start

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

總結

以上是生活随笔為你收集整理的【亲测有效】Centos安装完成docker后启动docker报错docker: unrecognized service的两种解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。