I have an application that deploys through Marathon multiple similar servers (containerized in Docker containers), using Marathon auto-assigning 'port' feature. That is nice and excatly the way I need in my app.
The problem is that my servers deployed in Marathon (PyWPS servers) are using code that does not fit really well with modern distributed architecture. PyWPS requests to define into a static config file, the IP and Port for the polling from the client apps.
When I have static IP/ports on my containers, it is easy to run a script (inside the container) at the launch of the container that 'sed' the config file to put the right IP/port values from a ENVVAR that I set in the container starting command line.
The problem arise when it comes to use undeterministic dynamic IP/port. Is there a way to catch these info in the container when it is deployed by Marathon, as a kind of event "container_start" hook ?