Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Inspecting a Network, doesn't give me the Container ID associated with the network #241

Open
bvandewalle opened this issue Jul 8, 2016 · 0 comments

Comments

@bvandewalle
Copy link

When I query the Network and associated Containers on Docker CLI, I get the following:

root@ubuntu:~# docker network inspect b1
[
    {
        "Name": "b1",
        "Id": "52a3537307b177688b2684a5448396e6bcdded9f9e4b9ee9175c7b84fcbb6fe0",
        "Scope": "local",
        "Driver": "nuage",
        "EnableIPv6": false,
        "IPAM": [....],
        "Internal": false,
        "Containers": {
            "9e70c53a64406f3e8e7385e2efb93c7dd14278c8d5163c2c0137f7a80c1ade1c": {
                "Name": "kickass_allen",
                "EndpointID": "8121ce08011b3dc689de821d7eaccb1ff37f0480928d78a9f49c36263d9d8831",
                "MacAddress": "7a:42:3b:2e:a4:bf",
                "IPv4Address": "10.107.54.2/24",
                "IPv6Address": ""
            }
        },
[...]
    }
]

I can get the list of containers associated with that Network. the key for those container is the ID of that container (in this case 9e70c...).

However, when I use this dockerclient lib, the key becomes the Endpoint with an added substring of ep-

map[ep-8121ce08011b3dc689de821d7eaccb1ff37f0480928d78a9f49c36263d9d8831:{kickass_allen 8121ce08011b3dc689de821d7eaccb1ff37f0480928d78a9f49c36263d9d8831 7a:42:3b:2e:a4:bf 10.107.54.2/24 }]

Since I need to report the Container ID, I need to make an extra call to list the containers and match the name to the ID.

Would it be possible to get the container ID as the key when inspecting networks ?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant