记一次CentOS 7安装Docker报错


CentOS 7安装Docker报错

在启动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命令,打印出相关的日志:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since 二 2021-10-05 20:46:32 CST; 17min ago
     Docs: https://docs.docker.com
  Process: 73617 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 73617 (code=exited, status=1/FAILURE)

10月 05 20:46:30 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
10月 05 20:46:30 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
10月 05 20:46:30 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
10月 05 20:46:30 localhost.localdomain systemd[1]: docker.service failed.
10月 05 20:46:32 localhost.localdomain systemd[1]: docker.service holdoff time over, scheduling restart.
10月 05 20:46:32 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
10月 05 20:46:32 localhost.localdomain systemd[1]: start request repeated too quickly for docker.service
10月 05 20:46:32 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
10月 05 20:46:32 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
10月 05 20:46:32 localhost.localdomain systemd[1]: docker.service failed.

没看出问题

执行journalctl -xe

10月 05 21:04:12 localhost.localdomain firewalld[960]: 2021-10-05 21:04:12 ERROR: COMMAND_FAILED: '/sbin/iptables -w2 -t filter -C DOCKER-ISOLATION-STAGE-2 -j RETURN' f
10月 05 21:04:12 localhost.localdomain dockerd[74446]: time="2021-10-05T21:04:12.094777731+08:00" level=info msg="Default bridge (docker0) is assigned with an IP addres
10月 05 21:04:12 localhost.localdomain firewalld[960]: 2021-10-05 21:04:12 ERROR: COMMAND_FAILED: '/sbin/iptables -w2 -t nat -C DOCKER -i docker0 -j RETURN' failed: ipt
10月 05 21:04:12 localhost.localdomain firewalld[960]: 2021-10-05 21:04:12 ERROR: COMMAND_FAILED: '/sbin/iptables -w2 -D FORWARD -i docker0 -o docker0 -j DROP' failed: 
10月 05 21:04:12 localhost.localdomain firewalld[960]: 2021-10-05 21:04:12 ERROR: INVALID_ZONE: docker
10月 05 21:04:12 localhost.localdomain dockerd[74446]: time="2021-10-05T21:04:12.146872870+08:00" level=warning msg="unmountAndDeactivate: open /var/lib/docker/devicema
10月 05 21:04:12 localhost.localdomain dockerd[74446]: failed to start daemon: Error initializing network controller: Error creating default "bridge" network: Failed to
10月 05 21:04:12 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
10月 05 21:04:12 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.

tg大佬指导关闭防火墙,启动成功.

附上 Stack Overflow链接 Stack Overflow

声明:纯情阿丁|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - 记一次CentOS 7安装Docker报错


阿丁在Coding,等你成为我的朋友!