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

16th
Dec 2015
Ryan Baxter
@ryanjbaxter
Dec 16 2015 02:48
@mattreyuk I guess the thing I do not like about that approach is that if the name of the eureka container changes in the docker compose file your configuration in the app will break
Matt Reynolds
@mattreyuk
Dec 16 2015 03:01
@ryanjbaxter true but if you're specifying everything in a compose yml, the other containers that link to it are right there so that seems less of an issue to me. I guess I'm wondering why would you ever change your eureka container name?
Ryan Baxter
@ryanjbaxter
Dec 16 2015 20:08
@mattreyuk I guess my problem is that you configure where the eureka server lives in your application.yml file while the name of the eureka container that is placed in the hosts file of the container running the app is in the docker-compose.yml file and the two are disconnected. so relying on the the host name of the container is a little fragile IMO because technically i can change the name of the eureka container in my docker-compose.yml file and if i don’t change it in my application.yml file and rebuild the app everything breaks
Dave Syer
@dsyer
Dec 16 2015 20:23
You could use a placeholder in application.yml and set everything in the docker-compose.yml
Someone told me that /etc/hosts support in docker is going to be removed though
So we'll have to find another approach at some point
Ryan Baxter
@ryanjbaxter
Dec 16 2015 20:25
you mean setting an env variable in the docker-compose file with the host name?
Dave Syer
@dsyer
Dec 16 2015 20:26
Yes
I've been doing that
Ryan Baxter
@ryanjbaxter
Dec 16 2015 20:26
right, i thought about that as well
Dave Syer
@dsyer
Dec 16 2015 20:27
It's nice because you can default it in the application.yml to localhost and run all in the same host as well