CentOS7 Docker容器启动失败 Failed to start Docker Application Container Engine的解决办法

[root@localhost ~]#  systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:27:04 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@localhost ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Tue 2020-03-17 14:26:55 EDT; 34s ago
     Docs: https://docs.docker.com
  Process: 7400 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 7400 (code=exited, status=1/FAILURE)

Mar 17 14:26:52 localhost.localdomain systemd[1]: docker.service failed.
Mar 17 14:26:55 localhost.localdomain systemd[1]: docker.service holdoff time over, ....
Mar 17 14:26:55 localhost.localdomain systemd[1]: Stopped Docker Application Contain....
Mar 17 14:26:55 localhost.localdomain systemd[1]: start request repeated too quickly...e
Mar 17 14:26:55 localhost.localdomain systemd[1]: Failed to start Docker Application....
Mar 17 14:26:55 localhost.localdomain systemd[1]: Unit docker.service entered failed....
Mar 17 14:26:55 localhost.localdomain systemd[1]: docker.service failed.
Mar 17 14:26:59 localhost.localdomain systemd[1]: start request repeated too quickly...e
Mar 17 14:26:59 localhost.localdomain systemd[1]: Failed to start Docker Application....
Mar 17 14:26:59 localhost.localdomain systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Tue 2020-03-17 14:26:55 EDT; 40s ago
     Docs: https://docs.docker.com
  Process: 7400 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 7400 (code=exited, status=1/FAILURE)

Mar 17 14:26:52 localhost.localdomain systemd[1]: docker.service failed.
Mar 17 14:26:55 localhost.localdomain systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 17 14:26:55 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
Mar 17 14:26:55 localhost.localdomain systemd[1]: start request repeated too quickly for docker.service
Mar 17 14:26:55 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Mar 17 14:26:55 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Mar 17 14:26:55 localhost.localdomain systemd[1]: docker.service failed.

这个可以通过如下方式解决:

查看文件系统 /etc/docker/daemon.json 有没有这个文件,没有测创建它包括二级目录 docker

在daemon.json文件中输入以下内容:

{
"storage-driver":"devicemapper"
}

 

 

保存好退出后,记得重启docker,最后终于启动成功了

[root@localhost docker]# docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:27:04 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:25:42 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
[root@localhost docker]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
[root@localhost docker]# 

 

你可能感兴趣的:(Docker)