Docker无法启动: Error initializing network controller: list bridge addresses failed

安装

安装官方文档进行安装

问题

然后执行启动命令:

systemctl start docker

报错,无法启动,提示使用命令查看详细日志:

jouralctr -xe

或者手动启动查看启动过程

sudo dockerd

发现关键的一句话:

failed to start daemon: Error initializing network controller: list bridge addresses failed: PredefinedLocalScopeDefaultNetworks List: [172.17.0.0/16 172.18.0.0/16 172.19.0.0/16 172.20.0.0/16 172

问题是docker创建网卡的IP地址可能被占用,导致docker网卡无法创建

排查

执行命令查看路由表:

route -n

结果如下:

[root@4dim-test docker]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         218.18.153.129  0.0.0.0         UG    101    0        0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U     100    0        0 eth0
172.16.0.0      10.0.0.253      255.240.0.0     UG    0      0        0 eth0
192.168.0.0     10.0.0.253      255.255.0.0     UG    0      0        0 eth0
218.18.153.128  0.0.0.0         255.255.255.192 U     101    0        0 eth1

172.16的网段被占用,网络上有人提供的解决方案是删除该条路由,但是对于我的这个服务器这条路由是不能删除的,所以另外寻找其他方案。

解决

这篇文章有提到解决方案:

手动创建docker网卡,执行如下两条命令:

ip link add name docker0 type bridge  
ip addr add dev docker0 172.1.0.1/16 

你可能感兴趣的:(Docker)