paulc4 / microservices-demo

Demo application to go with Blog on spring.io
889 stars 830 forks source link

Doubts with -- registration.server.hostname #35

Closed blancaat closed 4 years ago

blancaat commented 4 years ago

Hi Paul! I'm here again. I don't understand how the '--registration.server.hostname' parameter works when we run a container. I have been reading the parameters of the docker run command with docker run --help, but I don't understand the creation of this parameter. I know that system environment variables exist, but that they are passed by parameter using: '--env Key-Value'. Isn't --registration.server.hostname a system environment variable? I know that the value you enter in that parameter is replaced in the '.properties' file of each eureka client and that serves to indicate to the client where the registration server is, but I don't know how Docker understands that parameter because what's normal and what it says in the documentation is passing it as an environment variable. I executed the order: 'docker run --name accounts --hostname accounts --network accounts-net -p 2222:2222 paulc4/microservice java -jar app.jar accounts --env registration.server.hostname= but it doesn't work, so I assume it's not the same. Thanks!