错误的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.service
的status
# 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
如果包含格式不正确的JSON
,Docker
将无法启动
检查了一下daemon.json
,果真,少了一个“
。
修改daemon.json
,然后重启解决了。
参考
【docker安装完了以后,服务启动不了】http://www.docker.org.cn/thread/72.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 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上本地化部署