Hi Solomon,
Awesome! I saw a discussion about this on GitHub earlier today - I think integrating Pipework would be a great opportunity to refactor the networking side a bit. Currently it very much assumes one IPv4 address with port forwarding which offers a pretty limited range of use cases. Yesterday I hacked up IPv6 support (https://github.com/dotcloud/docker/pull/2974) but it's very much embedded in the current framework - it works well, since IPv6 doesn't require NAT or anything particularly fancy but still shares the limitations of the original code (docker0 bridge, single addresses).
Personally, I use Docker for Orchestrator (https://github.com/cvlc/orchestrator) and on a few of my development servers, almost exclusively with pipework.
It'd be great to throw around some new network architecture ideas - starting with user-customizable IP and IPv6 addresses and ranges (with multiple addresses of each possible), the ability to choose between DHCP/static custom addresses/automatically generated local networks and configurable target bridge (brctl/OpenVZ? NATed with exposed ports or NATed by IP, or even routed according to predefined IP-MAC pairs in an address pool). Most of these features are already available through pipework and those that aren't shouldn't require any more refactoring than would be required to get Pipework integrated. Obviously there's a line between customizability and the ability to support users and build stable software but I think a bottom-up redesign could better fit that balance than the current code and make everything simpler/more maintainable in the future.
Regards,
Calum
-- Cordialement, KiOrKY GPG Key FingerPrint: 0x1A1194B7681112AF Pensez à l’environnement. N’imprimez ce courriel que si vous en avez vraiment besoin.
Hey Calum,There's a lot to think about in there. Thanks for sharing.On the SNAT thing: we use iptables to link our MACVLAN interface with the Docker-provided (172.17.0.0) address rather than using pipework because having two interface inside the namespace was causing issues with some of our stuff. However, doing that made all outbound traffic appear to come from the host IP address, just as it does in "vanilla" Docker setup. Hence we added SNAT to rewrite the outbound IP source address to be that of the MACVLAN interface so that traffic originates from the IP of the container.So my ideal setup would be not to use SNAT at all, but just to have the equivalent of pipework merged into Docker - a correctly configured (veth) interface inside the namespace such that all inbound and outbound traffic is correctly addressed, BUT as the sole interface in the namespace (i.e. not the current two-interface situation that pipework sets up) AND set up at the right point in the lifecycle that it's ready to go as soon as the containerised process starts, not some number of millis later.Make sense?
D.