mesosphere/marathon — pull request #832 by alex3305 (2014-11-26 12:43:30+00:00)
Title: Add support for Docker container ports within HAProxy bridge

I had an issue regarding Docker containers and HAProxy. I wanted to proxy the specified container port to multiple containers with random port assignments. For instance; 192.168.1.1:80 > 192.168.1.2:32000 && 192.168.1.3:32001

This commit adds a new function to the HAProxy-marathon-bridge shell script which is basically a copy of the apps function; however this retrieves the so called containerPort and sets it in the HAProxy configuration. This allows HAProxy to be used to directly map to running containers that are started within Marathon.