系统:Debian 11 x64
安装报错。
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details. invoke-rc.d: initscript docker, action “start” failed. ● docker.service – Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Sat 2022-04-02 14:00:32 EDT; 3ms ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Process: 59130 ExecStart=/usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 59130 (code=exited, status=1/FAILURE) CPU: 84ms Apr 02 14:00:32 Tokyo768 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE Apr 02 14:00:32 Tokyo768 systemd[1]: docker.service: Failed with result ‘exit-code’. Apr 02 14:00:32 Tokyo768 systemd[1]: Failed to start Docker Application Container Engine. dpkg: error processing package docker-ce (–configure): installed docker-ce package post-installation script subprocess returned error exit status 1 Setting up git (1:2.30.2-1) … Processing triggers for man-db (2.9.4-2) … Processing triggers for libc-bin (2.31-13+deb11u2) … Errors were encountered while processing: docker-ce E: Sub-process /usr/bin/dpkg returned an error code (1) 复制代码
运行docker提示:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
重启提示:
root@Tokyo768:/etc/systemd/system# 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.
Journalctl -xe:
— Journal begins at Tue 2021-12-28 22:34:18 EST, ends at Sat 2022-04-02 14:05:27 EDT. — Apr 02 14:00:32 Tokyo768 systemd[1]: Starting Docker Application Container Engine… Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.257288199-04:00″ level=info msg=”Starting up” Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.283097177-04:00″ level=info msg=”parsed scheme: “unix\> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.283250106-04:00” level=info msg=”scheme “unix” not re> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.283359823-04:00″ level=info msg=”ccResolverWrapper: sen> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.283451357-04:00″ level=info msg=”ClientConn switching b> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.285138438-04:00″ level=info msg=”parsed scheme: “unix\> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.285242835-04:00” level=info msg=”scheme “unix” not re> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.285329068-04:00″ level=info msg=”ccResolverWrapper: sen> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.285406365-04:00″ level=info msg=”ClientConn switching b> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.316903933-04:00″ level=info msg=”Loading containers: st> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.325245571-04:00″ level=warning msg=”Running modprobe br> Apr 02 14:00:32 Tokyo768 dockerd[59130]: time=”2022-04-02T14:00:32.331919746-04:00″ level=warning msg=”Running iptables –> Apr 02 14:00:32 Tokyo768 dockerd[59130]: failed to start daemon: Error initializing network controller: error obtaining co> Apr 02 14:00:32 Tokyo768 dockerd[59130]: (exit status 4) Apr 02 14:00:32 Tokyo768 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE Apr 02 14:00:32 Tokyo768 systemd[1]: docker.service: Failed with result ‘exit-code’. Apr 02 14:00:32 Tokyo768 systemd[1]: Failed to start Docker Application Container Engine. Apr 02 14:00:34 Tokyo768 systemd[1]: docker.service: Scheduled restart job, restart counter is at 1. Apr 02 14:00:34 Tokyo768 systemd[1]: Stopped Docker Application Container Engine. Apr 02 14:00:34 Tokyo768 systemd[1]: Starting Docker Application Container Engine… Apr 02 14:00:34 Tokyo768 dockerd[60631]: time=”2022-04-02T14:00:34.570550777-04:00″ level=info msg=”Starting up” Apr 02 14:00:34 Tokyo768 dockerd[60631]: time=”2022-04-02T14:00:34.573689343-04:00″ level=info msg=”parsed scheme: “unix\> Apr 02 14:00:34 Tokyo768 dockerd[60631]: time=”2022-04-02T14:00:34.573835961-04:00” level=info msg=”scheme “unix” not re>复制代码
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Invalid argument复制代码
四川省网友说:直接宝塔Docker管理器 简单快捷
江西省网友说:一样报错
贵州省网友说:你这是apt安装的?curl -s https://get.docker.com | sudo sh
河北省网友说:对啊,用这个脚本装也一样报这个错。
青海省网友说:记错了
你dd个纯净的系统再用脚本吧
辽宁省网友说:failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Invalid argument
好像是网卡的锅?
江西省网友说:是不是装了什么防火墙
山西省网友说:啥也没装,Vir东京的小白鼠机器。
山东省网友说:别用服务启动, 手动命令行启动 /usr/bin/dockerd 查看报错信息
湖南省网友说:curl -L get.docker.com|bash
黑龙江省网友说:大佬帮忙看看
陕西省网友说:https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269
转换为传统模式
sudo update-alternatives –set iptables /usr/sbin/iptables-legacy
sudo update-alternatives –set ip6tables /usr/sbin/ip6tables-legacy
甘肃省网友说:看来应该是系统的问题,Vir东京提前开机的小白鼠机。
贵州省网友说:https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269
转换为传统模式
sudo update-alternatives –set iptables /usr/sbin/iptables-legacy
sudo update-alternatives –set ip6tables /usr/sbin/ip6tables-legacy
执行后再重新启动服务测试
广东省网友说:我刚新装的 debian 11 x64 装 docker, 也没出现这个问题 奇怪.
山西省网友说:unix:///run/containerd/containerd.sock
这个提示未注册是容器服务没有启动成功.
安徽省网友说:可以一启动就报错啊
陕西省网友说:大佬也是VIR东京么
台湾省网友说:不是, 下午买的其他家的机器, 才开通.
山西省网友说:google一下
scheme “unix” not registered, fallback to default scheme module=grpc
很多都是在讲这个,应该总有一个适合你
山东省网友说:转换后少报了一条错误
WARN[2022-04-02T15:56:11.074450966-04:00] Running modprobe bridge br_netfilter failed with message: modprobe: ERROR: could not insert ‘bridge’: Key was rejected by service modprobe: ERROR: could not insert ‘br_netfilter’: Key was rejected by service insmod /lib/modules/5.10.0-10-amd64/kernel/net/bridge/bridge.ko insmod /lib/modules/5.10.0-10-amd64/kernel/net/bridge/bridge.ko , error: exit status 1 INFO[2022-04-02T15:56:11.090697944-04:00] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option –bip can be used to set a preferred IP address failed to start daemon: Error initializing network controller: Error creating default “bridge” network: package not installed 复制代码