CentOS7安装docker解决启动不了的问题
CentOS7安装docker 启动不了,在⼯作当中遇到这个问题,当时急的不清,⽹上资料⼜不多,不过经过⾃⼰的捣⿎终于解决了
这个问题!
[root@test ~]# yum update
[root@test ~]# yum install docker
[root@test ~]# 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.
[root@test ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead) (Result: exit-code) since 四 2016-03-10 13:01:21 CST; 7s ago
Docs: docs.docker
Process: 29939 ExecStart=/usr/bin/docker daemon $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=2) Main PID: 29939 (code=exited, status=2)
CGroup: /system.slice/docker.service
└─4 -E nodiscard,lazy_itable_init=0,lazy_
3⽉ 10 13:01:20 test.mayocase systemd[1]: Failed to start
3⽉ 10 13:01:20 test.mayocase systemd[1]: Unit docker.service
3⽉ 10 13:01:20 test.mayocase systemd[1]: docker.service failed.
3⽉ 10 13:01:21 test.mayocase systemd[1]: docker.service holdoff
Hint: Some lines were ellipsized, use -l to show in full.
[root@test ~]#
使⽤yum install docker安装完后启动不了
[root@apptest ~]# service docker start
Redirecting to /bin/systemctl start docker.service
⼀直停留在以上步骤
可以使⽤以下命令来安装,即可成功。
exited⼀个问题让我折腾了两天,试过关闭防⽕墙,关闭selinux,重装系统,等等⽹上能查到的⽅法都解决不了。
如果⼤家解决了,回复感谢下我吧。
[root@apptest ~]# yum remove docker
[root@apptest ~]# yum remove docker-selinux
[root@pos.d]# vi /pos.po
[dockerrepo]
name=Docker Repository
baseurl=/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=/gpg
[root@pos.d]# yum install docker-engine
已安装:
docker-engine.x86_64 0:1.10.s
作为依赖被安装:
[root@apptest ~]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@apptest ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@pos.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@pos.d]#
或者使⽤以下⽅法
[root@apptest ~]# curl -fsSL get.docker/ | 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.s.noarch.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID 2c52609d: NOKEY docker-engine-selinux-1.10.s.noarch.rpm 的公钥尚未安装
导⼊ GPG key 0x2C52609D:
⽤户ID : "Docker Release Tool (releasedocker) <docker@docker>"
指纹 : 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
来⾃ : /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 ~]#
感谢阅读,希望能帮助到⼤家,谢谢⼤家对本站的⽀持!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论