突然发小 docker ps 没有正常列出容器,而是返回了标题的信息。
查通义千问:
让重启 docker服务。sudo systemctl start docker
返回如下错误
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
root@ps-Z690-UD-DDR4-V2:/home/ps# systemctl status docker.service
× docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-05-14 09:37:35 CST; 11s ago
TriggeredBy: × docker.socket
Docs: https://docs.docker.com
Process: 64391 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 64391 (code=exited, status=1/FAILURE)
CPU: 243ms
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Failed with result 'exit-code'.
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 systemd[1]: Failed to start Docker Application Container Engine.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: Stopped Docker Application Container Engine.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Start request repeated too quickly.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Failed with result 'exit-code'.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: Failed to start Docker Application Container Engine.
再查通义千问
让查journalctl -u docker.service -f
返回如下:
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 dockerd[64391]: time="2024-05-14T09:37:33.049471207+08:00" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=plugins.moby
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 dockerd[64391]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: Iptables not found
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Failed with result 'exit-code'.
5月 14 09:37:33 ps-Z690-UD-DDR4-V2 systemd[1]: Failed to start Docker Application Container Engine.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: Stopped Docker Application Container Engine.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Start request repeated too quickly.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: docker.service: Failed with result 'exit-code'.
5月 14 09:37:35 ps-Z690-UD-DDR4-V2 systemd[1]: Failed to start Docker Application Container Engine.
再查通义千问:
让安装 iptables:sudo apt-get update sudo apt-get install iptables
-
重启Docker服务:安装或确认
iptables
正确安装后,需要重启Docker服务以使更改生效: -
sudo systemctl restart docker
-
注销用户,重新登录,问题解决