FREEIPA_QA

IPv6 stack is enabled in the kernel but there is no interface that has ::1 address assigned. Add ::1 address resolution to ‘lo’ interface. You might need to enable IPv6 on the interface ‘lo’ in sysctl.conf.

使用docker run生成容器时报出错误

1
2
3
docker run --name freeipa-server --privileged=true -p 80:80 -p 389:389 -p 443:443 -ti -h freeipa.bhfae.local -v /sys/fs/cgroup:/sys/fs/cgroup:ro --tmpfs /run --tmpfs /tmp -v /data/freeipa:/data:Z --restart=on-failure:3 freeipa/freeipa-server --no-ntp 

IPv6 stack is enabled in the kernel but there is no interface that has ::1 address assigned. Add ::1 address resolution to 'lo' interface. You might need to enable IPv6 on the interface 'lo' in sysctl.conf.
  1. 通过报错信息判断是宿主机需要开启IPV6配置
  2. 宿主机通过/etc/sysctl.conf配置文件添加下面配置后 通过sysctl -p命令 使内核参数生效,但容器生成依旧报错
  3. 思索应该是freeipa的配置文件中监听了ipv6地址,宿主机系统层面已经开启了ipv6,但是docker服务自身应该也有ipv6的配置,需要添加配置,在/etc/docker/daemon.json中添加了ipv6配置 并重启dokcer服务后,容器正常启动了
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    [root@freeipa ~]# sysctl -p 
    vm.swappiness = 80
    net.ipv4.ip_forward = 1
    net.ipv6.conf.all.disable_ipv6 = 0
    net.ipv6.conf.default.disable_ipv6 = 0
    net.ipv6.conf.lo.disable_ipv6 = 0
    [root@freeipa ~]# cat /etc/docker/daemon.json
    {
    "registry-mirrors":["https://b9pmyelo.mirror.aliyuncs.com"],
    "ipv6": true,
    "fixed-cidr-v6": "fc00:17:1:1::/64"
    }
    [root@freeipa ~]#systemctl restart docker

FREEIPA_QA
https://imwang77.github.io/2021/02/18/FREEIPA_QA/
作者
imwang77
发布于
2021年2月18日
更新于
2024年1月3日
许可协议