如何在本地配置Docker容器以能够连接到远程领事?

I develop application with spring-cloud and consul When I run the application locally directly from InteliJ and I connect to remote service with RestTemplate annotated with @LoadBalanced. When I am trying to do the sam, but from docker container, I receive

java.lang.IllegalStateException:没有适用于服务名称的实例

领事实例是相同的,所有环境变量似乎都相同。可能是什么原因?

评论