赞
踩
sudo 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.
systemctl status docker.service
Dec 20 10:50:53 dell-08 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Dec 20 10:50:53 dell-08 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Dec 20 10:50:53 dell-08 systemd[1]: Stopped Docker Application Container Engine.
Dec 20 10:50:53 dell-08 systemd[1]: docker.service: Start request repeated too quickly.
Dec 20 10:50:53 dell-08 systemd[1]: docker.service: Failed with result 'exit-code'.
Dec 20 10:50:53 dell-08 systemd[1]: Failed to start Docker Application Container Engine.
journalctl -u docker.service
Dec 20 09:47:19 dell-08 systemd[1]: Starting Docker Application Container Engine...
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.785505287+08:00" level=info msg="Starting up"
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.786331056+08:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.883310307+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2"
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.883859748+08:00" level=info msg="Loading containers: start."
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.889121555+08:00" level=warning msg="failed to find iptables" error="exec: \"iptables\": executable file not found in $PATH"
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.890948078+08:00" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
Dec 20 09:47:19 dell-08 dockerd[9897]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: Iptables not found
Dec 20 09:47:19 dell-08 dockerd[9897]: time="2023-12-20T09:47:19.891967113+08:00" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=plugins.moby
Dec 20 09:47:19 dell-08 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Dec 20 09:47:19 dell-08 systemd[1]: docker.service: Failed with result 'exit-code'.
Dec 20 09:47:19 dell-08 systemd[1]: Failed to start Docker Application Container Engine.
Dec 20 09:47:21 dell-08 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
这些错误表明 Docker 无法找到 iptables 命令,它是用于配置网络规则和转发的重要工具。缺少 iptables 可能会导致 Docker 无法初始化网络控制器,从而无法启动。
1.检查 iptables 是否已正确安装在系统上。您可以在终端中运行以下命令来检查:
which iptables
2.如果 iptables 未安装,请根据您使用的操作系统和软件包管理器执行适当的安装命令。例如,对于基于 Debian 的系统(如 Ubuntu),您可以运行以下命令来安装 iptables:
sudo apt-get update
sudo apt-get install iptables
3.确保 iptables 被正确配置,并且其可执行文件位于系统的可执行路径中。您可以使用以下命令验证 iptables 的位置:
echo $PATH
确保输出中包含 /sbin
或 /usr/sbin
目录,这些目录通常包含 iptables
可执行文件。
sudo systemctl start docker
查看状态
systemctl status docker.service
如果还是不行,并且提示 iptables已经存在
sudo apt-get install --reinstall iptables
使用这个命令可以重新安装
造成这个不能使用的原因:个人遇到 1.重启(但是别的服务器没有问题)2.中病毒(服务器中了挖矿病毒,之前杀毒的时候遇到过这个问题,病毒会修改某个组件的命令让其不可用)
which iptables
注意:路径可能不同 但是有输出应该没问题
sudo systemctl start docker
the end…
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。