0

I have followed the official guide here, in the section Add Containers to a New Bridge Network, but I cannot replicate the results promised in the guide; I cannot get two containers on a bridge network to resolve each other by hostname. They can communicate using the IP address just fine, but they will not resolve each others hostnames.

How can I actually get two containers on a VCH to resolve each others hostname? It seems like such a simple thing; What could I have done wrong?

Actual output:

bash-5.0# ping client
ping: client: Try again
bash-5.0# ping server
ping: server: Try again
bash-5.0# curl 172.19.0.2
Praqma Network MultiTool (with NGINX) - tool1 - 172.19.0.2/16
bash-5.0# curl 172.19.0.3
Praqma Network MultiTool (with NGINX) - 1667e39f5a44 - 172.19.0.3/16

In fact those hostnames are the names of containers on a different bridge network alltogther.

This is the output of the 'network inspect' of their bridge network.

    $ docker network inspect my-bridge-network
[
    {
        "Name": "my-bridge-network",
        "Id": "f720a66731d31238d3938d257666803226bdfedecce116697312f278a014bf12",
        "Created": "2020-07-20T06:29:04.678548891Z",
        "Scope": "",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.19.0.0/16",
                    "Gateway": "172.19.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Containers": {
            "1667e39f5a447d66d401b616ddb39f3076b0612ed7faba54d4e35fd5cf9aa17c": {
                "Name": "client",
                "EndpointID": "1667e39f5a447d66d401b616ddb39f3076b0612ed7faba54d4e35fd5cf9aa17c",
                "MacAddress": "",
                "IPv4Address": "172.19.0.3/16",
                "IPv6Address": ""
            },
            "9dfebb815d2a791315edb0dcf4f30a1146fa49037483721a006f00b1f9760731": {
                "Name": "server",
                "EndpointID": "9dfebb815d2a791315edb0dcf4f30a1146fa49037483721a006f00b1f9760731",
                "MacAddress": "",
                "IPv4Address": "172.19.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.