docker-ipv6nat icon indicating copy to clipboard operation
docker-ipv6nat copied to clipboard

Allow mapping IPv4 listen addresses to IPv6

Open mildred opened this issue 4 years ago • 2 comments

When port mapping is defined in Docker, it might be specifying a HostIP in addition to the HostPort. If the HostIp is defined, it's generally an IPv4 address. it might be great to have docker-ipv6nat be able to convert automatically the IPv4 listen addresses to IPv6 based on some mapping.

The use case is to work with the Nomad scheduler which automatically detect the HostIP based on network detection on the host. it does not support IPv6 there, and it might not be in the future as docker itself does not support IPv6 port mapping.

Suggested CLI flag: -map-ipv4=192.168.3.0/24=2001:912:1480:11::226,... (for example)

I can provide a PR for that

mildred avatar Mar 04 '20 11:03 mildred

@robbertkl AFAIK, Docker-IPv6NAT should only mirror Docker's own IPv4 behaviour to IPv6. I think, this is not a part of Docker-IPv6NAT. What do you think?

bephinix avatar May 27 '20 16:05 bephinix

I'm a bit on the fence on this one. You're right, the mapping is not part of Docker itself. However, the functionality of binding to an IP address is available in Docker but cannot be mirrored properly by docker-ipv6nat. This suggests a way to still be able to do it.

There's an associated PR as well (#50), but did not have time yet to look into it.

robbertkl avatar May 27 '20 20:05 robbertkl