These are chat archives for spring-cloud/spring-cloud

Oct 2016
Kirill Tolkachev
Oct 01 2016 08:41

@lavcraft You posted a question almost a year ago about dynamically setting the port in mesos. Did you get that working?

@ccit-spence it is unexpected question )) After year ago...

I run spring boot application in docker image with random port (marathon provide env property $PORT0, $PORT1...). After that, we need run app in this port :)
If you need correct advertise you ip and port you should bind app in docker contaner to port equals to external port. For IP/HOST workaround is similar

Part of my marathon manifest for some app:

java -Xmx{{manifest.user_api.xmx}}M -Djava.awt.headless=true -Duser.timezone=Europe/Moscow -server -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -DAPPLICATION_NAME=XXXXX  -jar $MESOS_SANDBOX/app-{{manifest.user_api.version}}.jar{{manifest.user_api.spring_profiles}} --logging.config=$MESOS_SANDBOX/logback.groovy --eureka.instance.hostname=$HOST$HOST --eureka.instance.nonSecurePort=$PORT0 --server.port=$PORT0",
Kirill Tolkachev
Oct 01 2016 10:31
I`d be happy to answer for questions about this topic)
But, i have a problem to represent my idea in english :)
Oct 01 2016 21:11
@lavcraft Thanks for the response, looking at your manifest example. Looks like we have came to the same conclusion. My manifest looks pretty close tou yours. Thanks for sharing!