Docker - 是否可以创建仅 IPv6 的桥接网络?

Docker - 是否可以创建仅 IPv6 的桥接网络?

是否可以创建仅具有 IPv6 地址的自定义桥接网络?

当我尝试通过以下方式创建自定义桥接网络时:

docker network create --driver bridge --ipv6 --subnet 2001:db8:2::/64 mybridge

并检查我得到的创建的网络:

[
{
    "Name": "mybridge",
    "Id": "b09351a7b7b4936bc0b3fdc7627d4a13ef3260d3f914ae347756f6358ab3a27d",
    "Created": "2019-02-26T11:41:37.261479401Z",
    "Scope": "local",
    "Driver": "bridge",
    "EnableIPv6": true,
    "IPAM": {
        "Driver": "default",
        "Options": {},
        "Config": [
            {
                "Subnet": "172.19.0.0/16",
                "Gateway": "172.19.0.1"
            },
            {
                "Subnet": "2001:db8:2::/64"
            }
        ]
    },
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "ConfigFrom": {
        "Network": ""
    },
    "ConfigOnly": false,
    "Containers": {},
    "Options": {},
    "Labels": {}
}

]

当我运行容器时它会获取 IPV4 地址:

root@ip-10-0-3-167:/home/ubuntu# docker run -d --net mybridge redis
75fac838472a94519f30e2bdbcc10403a7a952fce285ee5d258fd87f0773f618

"Containers": {
        "75fac838472a94519f30e2bdbcc10403a7a952fce285ee5d258fd87f0773f618": {
            "Name": "cocky_tesla",
            "EndpointID": "b2940a158646e4343564668abeb98aac519238d8a471dce26ee8e0f76a5c38e4",
            "MacAddress": "02:42:ac:13:00:02",
            "IPv4Address": "172.19.0.2/16",
            "IPv6Address": "2001:db8:2::2/64"
        }

附加信息:我正在使用 Ubuntu 服务器 16.04 EC2 实例,Docker 版本 18.09.2

相关内容