随笔 - 308  文章 - 0  评论 - 84  阅读 - 75万

错误的daemon.json配置,导致docker容器启动失败 Failed to start Docker Application Container Engine

docker学习-配置错误的源

问题点剖析

使用docker安装了nginx,编写Dockerfile,映射端口,终于跑起来了。但是,当我重启服务器,再次查看docker容器的状态,发现报错了。

# docker ps -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

然后重启docker

#  sudo service docker start
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed docker.service" followed by "systemctl start docker.service" again.

发现还是不行,根据提示查看docker.servicestatus

# 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: start-limit) since  2020-05-05 01:13:34 CST; 9s ago
     Docs: https://docs.docker.com
  Process: 1880 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 1880 (code=exited, status=1/FAILURE)

5 05 01:13:32 10.0.2.8 systemd[1]: docker.service: main process exited, code=exited, sta...URE
5 05 01:13:32 10.0.2.8 systemd[1]: Failed to start Docker Application Container Engine.
5 05 01:13:32 10.0.2.8 systemd[1]: Unit docker.service entered failed state.
5 05 01:13:32 10.0.2.8 systemd[1]: docker.service failed.
5 05 01:13:34 10.0.2.8 systemd[1]: docker.service holdoff time over, scheduling restart.
5 05 01:13:34 10.0.2.8 systemd[1]: Stopped Docker Application Container Engine.
5 05 01:13:34 10.0.2.8 systemd[1]: start request repeated too quickly for docker.service
5 05 01:13:34 10.0.2.8 systemd[1]: Failed to start Docker Application Container Engine.
5 05 01:13:34 10.0.2.8 systemd[1]: Unit docker.service entered failed state.
5 05 01:13:34 10.0.2.8 systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

分析发现原因是docker不能启动

Failed to start Docker Application Container Engine.

daemon.json如果包含格式不正确的JSONDocker将无法启动

检查了一下daemon.json,果真,少了一个

修改daemon.json,然后重启解决了。

参考

【docker安装完了以后,服务启动不了】http://www.docker.org.cn/thread/72.html

posted on   ZhanLi  阅读(6760)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示