docker/docker — pull request #8515 by duglin (2014-10-11 20:19:28+00:00)
Title: Add DOCKER_LINKS and *_PORTS env vars when linking containers

Add two new env vars:
DOCKER_LINKS - lists the container aliases that this container is linked to
*_PORTS - lists all of the port/proto's for a particular container alias

Net result is:
new: DOCKER_LINKS= ...
new: link1_PORTS=/ / ...
old: link1_NAME=/
old: link1_PORT_port1_proto=://:
old: link1_PORT_port1_proto_ADDR=
old: link1_PORT_port1_proto_PORT=
old: link1_PORT_port1_proto_PROTO=

With this it should make it a lot easier to discover all of the ports
that are linked from within a container. W/o these two env vars people had
to iterate thru the env vars to find the list. Now there's a very clear way
to determine exactly what's there w/o looping/scanning.

Additionally, getting the *_NAME is now easier because there was no way
to discover this w/o either _just knowing_ the name in advance or looking
for all env vars that ended with _NAME, which seems very risky.

Signed-off-by: Doug Davis