Docker ipv6挂了

重启了下服务器,实体机屏幕上就报Docker起不来。查查日志吧

找原因

首先试图手动启动docker,如下:

1
2
3
sudo systemctl start docker.service 
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.

那再试试journalctl -xeu docker.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#  sudo journalctl -xeu docker.service

░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 3443 and the job result is failed.
Dec 02 20:28:57 nasserver systemd[1]: docker.service: Start request repeated too quickly.
Dec 02 20:28:57 nasserver systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Dec 02 20:28:57 nasserver systemd[1]: Failed to start docker.service - Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 3631 and the job result is failed.
...skipping...
░░
░░ The job identifier is 3443 and the job result is failed.
Dec 02 20:28:57 nasserver systemd[1]: docker.service: Start request repeated too quickly.
Dec 02 20:28:57 nasserver systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Dec 02 20:28:57 nasserver systemd[1]: Failed to start docker.service - Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 3631 and the job result is failed.

没啥用,看不出来啥有问题。那再试试dockerd

1
2
$ dockerd
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: ip6tab/les

这下挺明显了,daemon配的ipv6好像有问题。
查了下/etc/docker/daemon.json

1
2
3
4
5
6
7
8
9
10
11
12
{
"registry-mirrors": [
"https://dockerproxy.com",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
],
"ipv6": true,
"fixed-cidr-v6": "fd12:3456:789a:1::/64",
"experimental": true,
"ip6tab/les": true
}

是有这个选项,之前配nextcloud_aio的时候文档让我加的。不管了,先试试关闭。

结果

还真启动了。dockerd命令输出如下:

1
2
3
4
dockerd                          
INFO[2023-12-02T20:43:21.026752504+08:00] Starting up
WARN[2023-12-02T20:43:21.026829181+08:00] Running experimental build
dockerd needs to be started with root privileges. To run dockerd in rootless mode as an unprivileged user, see https://docs.docker.com/go/rootless/

nextcloud会不会有啥问题呢。但那应该是另一篇记录了HHH


Docker ipv6挂了
http://blog.jiuge.host/post/20231202203205.html
作者
Pigeon.🕊
发布于
2023年12月2日
许可协议
CC BY-NC-SA 3.0