【Docker】Error: Failed to start Docker Application Container Engine

本文提供了解决Docker服务问题的多种方法,包括直接重启Docker守护进程、使用systemctl工具启动Docker服务,以及通过修改Docker的配置文件来解决因json配置冲突导致的问题。深入探讨了如何在Ubuntu系统中,通过systemd进行Docker服务的高级配置,如添加TCP端口监听等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决方法0:

$ ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sudo sh 

$ nohup dockerd &


解决方法1:


$ ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sudo sh 
$ sudo systemctl start docker

解决方法2:

Same issue here. Seems the json conf can’t override the systemd one, which is a bug, IMHO.

In summary

First, delete the hosts entry from the json file.

Create a conf file in /etc/systemd/system/docker.service.d, e.g

/etc/systemd/system/docker.service.d/hosts.conf

Configure the start with the extra options. In my case, ubuntu with systemd, it uses file discovery sockets (fd://), and I added a tcp one.

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2736

Note the empty ExecStart. Seems to be an issue with how systemd declares units.

Save, reload

systemctl daemon-reload

and restart the service

systemctl restart docker.service

You should see the new settings

# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─hosts.conf
   Active: active (running) since Thu 2017-07-27 11:45:54 PDT; 3s ago
     Docs: https://docs.docker.com
 Main PID: 20482 (dockerd)
    Tasks: 18 (limit: 4915)
   Memory: 15.3M
      CPU: 351ms
   CGroup: /system.slice/docker.service
           ├─20482 /usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2736
           └─20489 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小涵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值