docker正常安装成功,但是启动服务报错Failed to startDocker……Engine
网上搜了好多但是都没有解决,最后试了好多错决定记录一下解决问题的原因
背景
- 我之前的kali Linux 是安装过docker的并且正常使用了一段时间。
- 最近突然发现docker的服务启动不起来了报如下错误
➜ run 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.
排查问题的整个过程
1.使用提示的命令查看到底是什么错误导致的
systemctl status docker.service
➜ run systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2019-09-08 09:37:15 CST; 2min 33s ago
Docs: https://docs.docker.com
Process: 18854 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 18854 (code=exited, status=1/FAILURE)
9月 08 09:37:15 barry systemd[1]: docker.service: Service RestartSec=100ms expired, scheduling restart.
9月 08 09:37:15 barry systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
9月 08 09:37:15 barry systemd[1]: Stopped Docker Application Container Engine.
9月 08 09:37:15 barry systemd[1]: docker.service: Start request repeated too quickly.
9月 08 09:37:15 barry systemd[1]: docker.service: Failed with result 'exit-code'.
9月 08 09:37:15 barry systemd[1]: Failed to start Docker Application Container Engine.
2. 在网上搜“Failed to start Docker Application Container Engine.”
收了好久都是删除配置,重新安装之类的帖子,都是在互相抄袭,这些帖子存在就是在重复造轮子,如果是一样的问题收藏就可以了何必在自己的博客里在写一份哪?(这些仅代表个人看法如果不认同勿喷)
3.在排查问题的过程中,在这篇帖子中得到了灵感,找到了一些新的线索
https://www. jianshu.com/p/93518610e ea1
4.直接使用dockerd命令启动docker服务
➜ docker dockerd
INFO[0000] libcontainerd: new containerd process, pid: 19654
WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=1048576
WARN[0001] failed to rename /var/lib/docker/tmp for background deletion: %!s(). Deleting synchronously
ERRO[0001] [graphdriver] prior storage driver aufs failed: driver not supported
Error starting daemon: error initializing graphdriver: driver not supported
至此最终导致docker服务启动不起来的根源问题浮出水面
ERRO[0001] [graphdriver] prior storage driver aufs failed: driver not supported
是由于驱动不支持导致的
5.在网上搜索Error starting daemon: error initializing graphdriver: driver not supported
按照慕课网上的一篇帖子解决了这个问题 https://www. imooc.com/article/detai ls/id/70557
# 具体解决问题是修改 /etc/docker/daemon.json
vi /etc/docker/daemon.json
# 添加如下内容
# 此配置与本次启动不起来docker服务无关
"registry-mirrors": ["自己的加速地址"],
# 此次docker服务启动不起来的解决办法是添加如下两个配置解决的问题,添加存储驱动
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"