问题:docker突然启动不了,然后也用不了docker的命令,报错如下。
[root@master opt]# docker network ls
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
1.检查docker的运行状态
[root@master opt]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2022-12-01 21:45:45 CST; 12s ago
Docs: Docker Documentation | Docker Documentation
Process: 2259 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.so>
Main PID: 2259 (code=exited, status=1/FAILURE)
12月 01 21:45:43 master systemd[1]: docker.service: Main process exited, code=exited, status=1>
12月 01 21:45:43 master systemd[1]: docker.service: Failed with result 'exit-code'.
12月 01 21:45:43 master systemd[1]: Failed to start Docker Application Container Engine.
12月 01 21:45:45 master systemd[1]: docker.service: Service RestartSec=2s expired, scheduling >
12月 01 21:45:45 master systemd[1]: docker.service: Scheduled restart job, restart counter is >
12月 01 21:45:45 master systemd[1]: Stopped Docker Application Container Engine.
12月 01 21:45:45 master systemd[1]: docker.service: Start request repeated too quickly.
12月 01 21:45:45 master systemd[1]: docker.service: Failed with result 'exit-code'.
12月 01 21:45:45 master systemd[1]: Failed to start Docker Application Container Engine.
2.尝试重启docker服务
启动报错如下
[root@master opt]# 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.
解决方案:
修改配置文件后缀 --->把/etc/docker/daemon.json文件的.json后缀,修改为.conf后缀
[root@master ~]# mv /etc/docker/daemon.json /etc/docker/daemon.conf
成功启动docker服务
[root@master ~]# systemctl start docker
查询docker服务状态
[root@master ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2022-12-01 22:03:20 CST; 7s ago
Docs: Docker Documentation | Docker Documentation
Main PID: 1723 (dockerd)
Tasks: 26
Memory: 51.1M
CGroup: /system.slice/docker.service
├─1723 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
├─1988 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5000 -container>
└─1994 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 5000 -container-ip 1>
12月 01 22:03:18 master dockerd[1723]: time="2022-12-01T22:03:18.289854312+08:00" level=warnin>
12月 01 22:03:18 master dockerd[1723]: time="2022-12-01T22:03:18.290249654+08:00" level=info m>
12月 01 22:03:19 master dockerd[1723]: time="2022-12-01T22:03:19.277350833+08:00" level=info m>
12月 01 22:03:19 master dockerd[1723]: time="2022-12-01T22:03:19.297006452+08:00" level=warnin>
12月 01 22:03:19 master dockerd[1723]: time="2022-12-01T22:03:19.352761031+08:00" level=info m>
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.154534118+08:00" level=info m>
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.427561039+08:00" level=info m>
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.427731869+08:00" level=info m>
12月 01 22:03:20 master systemd[1]: Started Docker Application Container Engine.
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.499788277+08:00" level=info m>文章来源:https://www.toymoban.com/news/detail-599312.html
lines 1-22/22 (END)文章来源地址https://www.toymoban.com/news/detail-599312.html
到了这里,关于docker启动报错:Job for docker.service failed because the control process exited with error code.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!