Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker inspect does not show IPv6 addresses #7042

Closed
MalteJ opened this issue Jul 15, 2014 · 11 comments
Closed

docker inspect does not show IPv6 addresses #7042

MalteJ opened this issue Jul 15, 2014 · 11 comments
Labels

Comments

@MalteJ
Copy link
Contributor

MalteJ commented Jul 15, 2014

"docker inspect mycontainer" does not show container's IPv6 address:

"NetworkSettings": {
    "Bridge": "docker0",
    "Gateway": "172.17.42.1",
    "IPAddress": "172.17.0.8",
    "IPPrefixLen": 16,
    "PortMapping": null,
    "Ports": {}
},

the ifconfig output inside the container:

root@5f54af0a7db0:/# ifconfig
eth0  Link encap:Ethernet  HWaddr 96:79:64:33:6f:17
      inet addr:172.17.0.9  Bcast:0.0.0.0  Mask:255.255.0.0
      inet6 addr: 2a11:4f8:140:2425:9479:64ff:fe33:6f17/64 Scope:Global
      inet6 addr: fe80::9479:64ff:fe33:6f17/64 Scope:Link
      UP BROADCAST RUNNING  MTU:1500  Metric:1
      RX packets:13 errors:0 dropped:4 overruns:0 frame:0
      TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:1490 (1.4 KB)  TX bytes:586 (586.0 B)

It would be nice to have a key "IPv6Address" under "NetworkSettings".

@tianon
Copy link
Member

tianon commented Jul 18, 2014

I think this would be an excellent justification for just switching to "IPAddresses" as an array, especially since having multiple IPv4 addresses is really not at all uncommon but even more importantly, having multiple IPv6 addresses is not only common, it's actually recommended to do so in the standards.

@cnf
Copy link
Contributor

cnf commented Sep 7, 2014

+1 on this one, I also would really need to get the IPv6 addresses exposed in network settings.

@MalteJ
Copy link
Contributor Author

MalteJ commented Sep 24, 2014

I have looked into this. The docker inspect only shows the IP address that was assigned to the container during creation. If you change the IP while the container is running, the IP in docker inspect will not get updated.
For container networking docker relies on libcontainer. libcontainer currently does not have a method to retrieve the container's current IP addresses.
That said I am currently working on an IPv6 implementation for docker, so that every container gets one IPv4 and one IPv6 address during creation (docker run --ipv6=true). Both addresses will be displayed by docker inspect given that they are known while creating the container.

@MalteJ
Copy link
Contributor Author

MalteJ commented Sep 24, 2014

One word about multiple IP addresses:
It is a big change in the code. In docker itself as well as in libcontainer.
I would go for one IPv4 and one IPv6 first and later try to extend it to multiple IPs.

@asbjornenge
Copy link
Contributor

👍 Any progress ? I need it for my DNS service discovery goodness 🐰 🚀

@MalteJ
Copy link
Contributor Author

MalteJ commented Oct 27, 2014

You can calculate the link-local IPv6 from the container's mac address.
The global IPv6 is currently not inspectable.

@MalteJ
Copy link
Contributor Author

MalteJ commented Nov 5, 2014

Opened a Pull Request that is implementing this: #8947

@asbjornenge
Copy link
Contributor

@MalteJ 👍 awesome!

@GM-Alex
Copy link

GM-Alex commented Jan 28, 2015

Any news on making the global IPv6 inspectable?

@jessfraz
Copy link
Contributor

It will be 1.5 :)

On Wednesday, January 28, 2015, Alexander Schneider <
notifications@github.com> wrote:

Any news on making the global IPv6 inspectable?


Reply to this email directly or view it on GitHub
#7042 (comment).

@GM-Alex
Copy link

GM-Alex commented Jan 28, 2015

@jfrazelle Great! 👍

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

No branches or pull requests

7 participants