CentOS7 安装docker 解决启动不了的问题

2020-06-17 06:38:12易采站长站整理

 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: http://docs.docker.com

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

└─29970 mkfs.ext4 -E nodiscard,lazy_itable_init=0,lazy_journal_ini...

3月 10 13:01:20 test.mayocase.com systemd[1]: Failed to start Docker Applic….

3月 10 13:01:20 test.mayocase.com systemd[1]: Unit docker.service entered f….

3月 10 13:01:20 test.mayocase.com systemd[1]: docker.service failed.

3月 10 13:01:21 test.mayocase.com systemd[1]: docker.service holdoff time o….

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

一直停留在以上步骤

可以使用以下命令来安装,即可成功。

一个问题让我折腾了两天,试过关闭防火墙,关闭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