龙空技术网

docker容器支持ipv6

编程和架构技术实战 63

前言:

现时咱们对“nginx无法启动 1067”大体比较关切,同学们都需要分析一些“nginx无法启动 1067”的相关资讯。那么小编也在网络上搜集了一些有关“nginx无法启动 1067””的相关知识,希望同学们能喜欢,大家一起来了解一下吧!

检查docker容器网段是否支持

docker inspect bridge

输出结果:

[    {        "Name": "bridge",        "Id": "4ea9d05c76aa000022540551acdbb52e66795a1f171c1f03e6fd220de05f225b",        "Created": "2023-08-28T16:47:23.467219521+08:00",        "Scope": "local",        "Driver": "bridge",        "EnableIPv6": false,        "IPAM": {            "Driver": "default",            "Options": null,            "Config": [                {                    "Subnet": "172.17.0.0/16"                }            ]        },        "Internal": false,        "Attachable": false,        "Containers": {            "0e009ac5b95e333d5d5ceef058ed1869088af7d00f594f6815b5ed4c2fa04a66": {                "Name": "rabbitmq",                "EndpointID": "cd9c9ffc9aead3966bd54256101809f99a16399f8415dd2d10b2ba4340436e14",                "MacAddress": "02:42:ac:11:00:02",                "IPv4Address": "172.17.0.2/16",                "IPv6Address": ""            },            "33c035ab67a8a9444d20ae96e572271b72cf34d79813da6c9463da4aa2545f3f": {                "Name": "rancher",                "EndpointID": "23daed15eed3c24847fc33fbf68a632888e0865d0aa9d93c7056d00ea8b00271",                "MacAddress": "02:42:ac:11:00:03",                "IPv4Address": "172.17.0.3/16",                "IPv6Address": ""            },            "62ea798a035a381864d2fdc8430d82027acf9f3dca34c94767d6cca6aed3b836": {                "Name": "xxl-job-admin",                "EndpointID": "eff8a82aa73c0ddecc6d0b9de5255bfbec7aba9421450cc997d23cf01b4dca30",                "MacAddress": "02:42:ac:11:00:05",                "IPv4Address": "172.17.0.5/16",                "IPv6Address": ""            },            "90c8620a20499027bbed73cf8a18b437a688de3e07887d6f85984deeb45cd109": {                "Name": "postgres",                "EndpointID": "4215e0085ce66a20fb7e65a28e50897dd1b3eb279d8477d0a122bd3e13157a98",                "MacAddress": "02:42:ac:11:00:04",                "IPv4Address": "172.17.0.4/16",                "IPv6Address": ""            }        },        "Options": {            "com.docker.network.bridge.default_bridge": "true",            "com.docker.network.bridge.enable_icc": "true",            "com.docker.network.bridge.enable_ip_masquerade": "true",            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",            "com.docker.network.bridge.name": "docker0",            "com.docker.network.driver.mtu": "1500"        },        "Labels": {}    }]
查看docker镜像配置
cat /etc/docker/daemon.json

输出结果

{}
修改docker镜像配置支持ipv6备份文件/etc/docker/daemon.json
cp  /etc/docker/daemon.json /etc/docker/daemon.json.bak
修改文件/etc/docker/daemon.json(注意只追加不覆盖)
{ "experimental": true, "ip6tables": true, "ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64"}
重启docker
systemctl restart docker
查看docker网络是否支持ipv6
docker inspect bridge
[    {        "Name": "bridge",        "Id": "d8152b1067cda4d0dece2f8f01420b38df314d3bbe3ee0aa4bee75b9741a6365",        "Created": "2023-11-13T12:44:07.395758624+08:00",        "Scope": "local",        "Driver": "bridge",        "EnableIPv6": true,        "IPAM": {            "Driver": "default",            "Options": null,            "Config": [                {                    "Subnet": "172.17.0.0/16",                    "Gateway": "172.17.0.1"                },                {                    "Subnet": "2001:db8:1::/64"                }            ]        },        "Internal": false,        "Attachable": false,        "Ingress": false,        "ConfigFrom": {            "Network": ""        },        "ConfigOnly": false,        "Containers": {            "13ca2b715814390e81906abe205af8016de60458c7c6d5f31688290bda9dca73": {                "Name": "nginx",                "EndpointID": "b8a9219ef76d934484ee2829e17a406dc6d27e74c1557739c393cb7f32413796",                "MacAddress": "02:42:ac:11:00:05",                "IPv4Address": "172.17.0.5/16",                "IPv6Address": "2001:db8:1::242:ac11:5/64"            },            "755c6776b38a38e7c50e68c043e2da437a8224332c2ff4b06e29bece65bfd4de": {                "Name": "kibana-7.9.0",                "EndpointID": "5cc0937ca14c121ed9d62efa6b4e565d660e36185f6500c3e10bb65687df4b6b",                "MacAddress": "02:42:ac:11:00:03",                "IPv4Address": "172.17.0.3/16",                "IPv6Address": "2001:db8:1::242:ac11:3/64"            },            "86e621f460d2dd8359e4a498712819ba9ca00c01f7fddd9074e0132852001d34": {                "Name": "logstash7.9.0",                "EndpointID": "ca91369cc58091037585010a49acd3e4c0763bd6c3879337d3499e57de1e2437",                "MacAddress": "02:42:ac:11:00:04",                "IPv4Address": "172.17.0.4/16",                "IPv6Address": "2001:db8:1::242:ac11:4/64"            },            "acc843fbfd33a233f1c14df7b8257a13bad7e516e6249cda861fb855f9cb36ce": {                "Name": "elasticsearch-7.9.0",                "EndpointID": "b75431953c3536067e52a30a5f975fb7cf0596d85ac75db4ec2958b7361a3133",                "MacAddress": "02:42:ac:11:00:02",                "IPv4Address": "172.17.0.2/16",                "IPv6Address": "2001:db8:1::242:ac11:2/64"            }        },        "Options": {            "com.docker.network.bridge.default_bridge": "true",            "com.docker.network.bridge.enable_icc": "true",            "com.docker.network.bridge.enable_ip_masquerade": "true",            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",            "com.docker.network.bridge.name": "docker0",            "com.docker.network.driver.mtu": "1500"        },        "Labels": {}    }]

标签: #nginx无法启动 1067