docker启动报错:Job for docker.service failed because the control process exited with error code.

这篇具有很好参考价值的文章主要介绍了docker启动报错:Job for docker.service failed because the control process exited with error code.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题: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.

docker.service: failed with result 'exit-code'.,docker,docker,容器,运维

2.尝试重启docker服务

  启动报错如下

docker.service: failed with result 'exit-code'.,docker,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>

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模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包