TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
182 stars 49 forks source link

document assigned public IP the same way swarm standalone does #132

Closed ndeloof closed 1 year ago

ndeloof commented 6 years ago

when a container is started on Joyent with exposed port, the assigned IP is documented as NetworkSettings.IpAddress

(simplified) docker inspect output :

[
    {
        "Driver": "sdc",
        "ExecDriver": "sdc-0.1",
        "NetworkSettings": {
            "IPAddress": "165.225.139.206",
            "Ports": {
                "7654/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "7654"
                    }
                ]
            }
        },
    }
]

please note:

same container ran with docker swarm (standalone) uses a distinct approach :

(simplified) docker inspect output :

[
    {
        "Node": {
            "IP": "192.168.99.102",
            "Name": "swarm-agent-01",
        },
        "NetworkSettings": {
            "Ports": {
                "22/tcp": [
                    {
                        "HostIp": "192.168.99.102",
                        "HostPort": "32768"
                    }
                ]
            },
            "IPAddress": "172.17.0.3",
            "Networks": {
                "bridge": {
                    "IPAddress": "172.17.0.3",
                }
            }
        }
    }
]

To avoid having to handle Joyent as a special case in generic docker tooling, it would be nice sdc do expose it's IP allocation in a coherent way with swarm (and maybe others). Especially, reporting "HostIp": "0.0.0.0" as NetworkSettings.Ports binding isn't useful here, actually allocated IP would be a nicer information.

see https://github.com/jenkinsci/docker-plugin/issues/552