Add port configs to Sandbox and libnetwork vendoring#21019
Add port configs to Sandbox and libnetwork vendoring#21019cpuguy83 merged 2 commits intomoby:masterfrom aboch:se
Conversation
|
|
|
@aboch I added "WIP" to the PR's title, can you remove that when it's ready for review? |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
This PR is ready for review. It carries multiple networking related fixes (from libnetwork) and the only docker side change is the migration of port-map config from endpoint to sandbox object. Some background on this change. During experimental version of docker (1.7+), we originally designed the endpoint object to carry the construct of port-mapping. But considering the backward compatible nature of port-mapping being a container property, we were trying to accommodate that through some unsustainable back-end sandbox / endpoint management. With this change, we are paying of that technical debt. |
|
WindowsTP4 timed out. We need to raise the limit |
|
ping @calavera can you have a look? This PR is needed for other PR's coming 😄 |
|
LGTM |
daemon/container_operations_unix.go
Outdated
There was a problem hiding this comment.
looks like this can just be portSpecs nat.PortSet since the only thing we are doing with it is portSpecs = container.Config.ExposedPorts and then ranging over it.
For that matter, maybe we can get rid of the variable altogether and range over container.Config.ExposedPorts directly.
There was a problem hiding this comment.
Yep, looks like. Will take care of this. Thanks.
|
Just the 1 nit |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
@cpuguy83 PTAL! |
|
LGTM |
Add port configs to Sandbox and libnetwork vendoring
|
I've asked a question in the forums about Enabling DNS Round Robin. I thought somebody here might know the answer and be willing to post over there. |
|
@everett-toews if works out of the box in Docker 1.11; Create a network and join two containers, give them both the same net-alias; run another container, and attach it to the same network; docker run -it --net foobar ubuntu
root@6aeee190588f:/# ping web
PING web (172.18.0.2) 56(84) bytes of data.
64 bytes from web1.foobar (172.18.0.2): icmp_seq=1 ttl=64 time=0.171 ms
64 bytes from web1.foobar (172.18.0.2): icmp_seq=2 ttl=64 time=0.121 ms
64 bytes from web1.foobar (172.18.0.2): icmp_seq=3 ttl=64 time=0.129 ms
^C
--- web ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.121/0.140/0.171/0.023 ms
root@6aeee190588f:/# ping web
PING web (172.18.0.3) 56(84) bytes of data.
64 bytes from web2.foobar (172.18.0.3): icmp_seq=1 ttl=64 time=0.170 ms
64 bytes from web2.foobar (172.18.0.3): icmp_seq=2 ttl=64 time=0.111 ms
64 bytes from web2.foobar (172.18.0.3): icmp_seq=3 ttl=64 time=0.111 ms
^C
--- web ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.111/0.130/0.170/0.030 ms |
|
I can confirm everything works as expected when using the docker CLI like you did along with my nginx load balancer. I suspect compose just hasn't caught up yet. I thought my compose config was the equivalent of the above but I could I misconfigured something too. |
|
@everett-toews it may be worth checking if nginx doesn't cache DNS (I think I heard some issues about that happening), you can try to |
|
@thaJeztah Good call. It was nginx doing DNS caching. You can override it, see resolver
I updated my example and compose is working now too. Sorry for the nginx related debugging noise! |
|
@everett-toews not at all! Happy to hear it's resolved (and of course that there's no bug involved) 👍 |
Vendoring libnetwork 0.7.0-dev.5:
Add exposed ports and port-mapping configs to Sandbox: