gpt4 book ai didi

linux - Docker 不会对 daemon.json 应用更改

转载 作者:行者123 更新时间:2023-12-04 19:05:43 26 4
gpt4 key购买 nike

我在 ubuntu 上创建了/etc/docker/daemon.json 文件,内容如下:

{
"ipv6": false
}
之后我重新启动机器,docker 仍在寻找 ipv6 地址,在 docker swarm init --advertise address enp0s3 上给我以下错误:
Error response from daemon: interface enp0s3 has more than one IPv6 address (2a00:c98:2060:a000:1:0:1d1e:ca75 and fe80::a00:27ff:fe7e:d9c4)
¿ 如何将更改应用到守护程序,以便不再遇到此错误?由于机器使用的是 dhcp,我无法公布特定的 IP 地址。
谢谢。

最佳答案

使用以下命令解决了该问题:

sudo docker swarm init --advertise-address "$(ip addr show $MAIN_ETH_INTERFACE | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)"
这样我就不需要指定 ipv4 地址。

关于linux - Docker 不会对 daemon.json 应用更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70199893/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com