Docker
- 请严格按照文档描述进行安装
- 请注意新系统版本
- 双网卡(WIFI + 4G)情况下Docker重启会报以下错误
值得一提的是, 重启系统后的Docker.service是正常运行的
// 就是这一行,意思大概是网卡地址找不到
Jun 18 16:40:21 Khadas dockerd[53863]: panic: runtime error: invalid memory address or nil pointer dereference
Jun 18 16:40:21 Khadas dockerd[53863]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5565ad51e8]
Jun 18 16:40:21 Khadas dockerd[53863]: goroutine 1 [running]:
// 其实这一行意思是Docker所需的外网网卡在获取地址的时候报了Go nilpointer
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/vendor/github.com/vishvananda/netlink.parseAddr({0x400013e94c, 0x38, 0x38})
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/vendor/github.com/vishvananda/netlink/addr_linux.go:274 +0x118
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/vendor/github.com/vishvananda/netlink.(*Handle).AddrList(0x40007e9e00, {0x5566f8f510, 0x4000b8cd80}, 0x2)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/vendor/github.com/vishvananda/netlink/addr_linux.go:199 +0x33c
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/vendor/github.com/docker/libnetwork/netutils.ElectInterfaceAddresses({0x55666fe903, 0x7})
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/vendor/github.com/docker/libnetwork/netutils/utils_linux.go:81 +0x124
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/daemon.initBridgeDriver({0x556701bda8, 0x4000168800}, 0x4000594b00)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/daemon/daemon_unix.go:949 +0x390
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/daemon.(*Daemon).initNetworkController(0x4000522000, 0x4000594b00, 0x4000573ad0)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/daemon/daemon_unix.go:892 +0x4d0
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/daemon.(*Daemon).restore(0x4000522000)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/daemon/daemon.go:490 +0x340
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/daemon.NewDaemon({0x5566fca1d0, 0x400004e340}, 0x4000594b00, 0x400062b9e0)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/daemon/daemon.go:1150 +0x2ce0
Jun 18 16:40:21 Khadas dockerd[53863]: main.(*DaemonCli).start(0x4000a33aa0, 0x40000a2960)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/cmd/dockerd/daemon.go:195 +0x99c
Jun 18 16:40:21 Khadas dockerd[53863]: main.runDaemon(...)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/cmd/dockerd/docker_unix.go:14
Jun 18 16:40:21 Khadas dockerd[53863]: main.newDaemonCommand.func1(0x40000be000, {0x4000a33a40, 0x0, 0x3})
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/cmd/dockerd/docker.go:34 +0x84
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/vendor/github.com/spf13/cobra.(*Command).execute(0x40000be000, {0x400013a010, 0x3, 0x3})
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:850 +0x668
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x40000be000)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:958 +0x404
Jun 18 16:40:21 Khadas dockerd[53863]: github.com/docker/docker/vendor/github.com/spf13/cobra.(*Command).Execute(...)
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:895
Jun 18 16:40:21 Khadas dockerd[53863]: main.main()
Jun 18 16:40:21 Khadas dockerd[53863]: /go/src/github.com/docker/docker/cmd/dockerd/docker.go:97 +0x1b4
Jun 18 16:40:21 Khadas systemd[1]: docker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 18 16:40:21 Khadas systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 18 16:40:21 Khadas systemd[1]: Failed to start Docker Application Container Engine.
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.777615043Z" level=debug msg="/usr/sbin/iptables, [--wait -t filter -C DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2]"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.781644415Z" level=debug msg="/usr/sbin/iptables, [--wait -t filter -D DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2]"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.785891329Z" level=debug msg="/usr/sbin/iptables, [--wait -t filter -C DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP]"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.789876659Z" level=debug msg="/usr/sbin/iptables, [--wait -t filter -D DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP]"
// 通过对日志的逐行排查,发现是这一条命令抛出来的
// 应该是Docker需要将所关联的网卡通过内存上存放的句柄释放地址池
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.796130362Z" level=debug msg="releasing IPv4 pools from network bridge (8a833baa39b2feafd4a7403328bece1ca9620bcc374acacba5eaed46337c8b73)"
//
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.796713987Z" level=debug msg="ReleaseAddress(LocalDefault/172.17.0.0/16, 172.17.0.1)"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.797275778Z" level=debug msg="Released address PoolID:LocalDefault/172.17.0.0/16, Address:172.17.0.1 Sequence:App: ipam/default/data, ID: LocalDefault/172.17.0.0/16, DBIndex: 0x0, Bi>
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.797866861Z" level=debug msg="ReleasePool(LocalDefault/172.17.0.0/16)"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.801329483Z" level=debug msg="cleanupServiceDiscovery for network:8a833baa39b2feafd4a7403328bece1ca9620bcc374acacba5eaed46337c8b73"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.801419149Z" level=debug msg="cleanupServiceBindings for 8a833baa39b2feafd4a7403328bece1ca9620bcc374acacba5eaed46337c8b73"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.806931520Z" level=info msg="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"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.807091020Z" level=debug msg="Allocating IPv4 pools for network bridge (a2f123f4c9df50d4b04c81e46fc93783455cddcfa89f200622b4b8b9d4466159)"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.807218353Z" level=debug msg="RequestPool(LocalDefault, 172.17.0.0/16, , map[], false)"
Jun 18 15:54:47 Khadas dockerd[3382]: time="2022-06-18T15:54:47.807324436Z" level=debug msg="RequestAddress(LocalDefault/172.17.0.0/16, 172.17.0.1, map[RequestAddressType:com.docker.network.gateway])"
请先禁用其中一张网卡连接
nmcli d disconnect 4G
有一种设想是Docker错误释放了另一张激活的网卡的IP池导致?
Docker底层了解不深,期待大佬解释一下