это мой Eureka Server application.property
# set port
server.port=8761
# no need to register the server with the server
eureka.client.register-with-eureka=false
# don't need a local copy of the registry
eureka.client.fetch-registry=false
Eureka Server dockerfile
FROM openjdk:8
ADD target/eureka-service.jar eureka-service.jar
EXPOSE 8761
ENTRYPOINT ["java", "-jar", "eureka-service.jar"]
Eureka Client приложение*с @ EnableEurekaClient
Клиент успешно зарегистрирован в EurekaServer и все работает нормально.Но когда я пытаюсь запустить это в Docker, используя ниже
Docker-Compose.yml
версия: "2.0"
services:
foo-service:
build: foo/
ports:
- "8761:8761"
bar-service:
build: bar/
ports:
- "8971:8971"
Клиент не может зарегистрироваться на сервере,и получаю ниже стека трассировки.
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
| at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111) ~[eureka-client-1.6.2.jar!/:1.6.2]
| at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-1.6.2.jar!/:1.6.2]
| at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59) ~[eureka-client-1.6.2.jar!/:1.6.2]
| at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.6.2.jar!/:1.6.2]
| at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-1.6.2.jar!/:1.6.2]
| at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:798) ~[eureka-client-1.6.2.jar!/:1.6.2]
| at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:104) [eureka-client-1.6.2.jar!/:1.6.2]
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_171]
| at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_171]
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_171]
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_171]
| at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]
| at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
Я действительно новый парень в Docker, любая помощь?