I use spring clound eureka feign create application.
I can run them in localhost, but when I run them in Docker, the feign can not call the service registered in eureka.
How can feign contact eureka when run in a docker container?
I use spring clound eureka feign create application.
I can run them in localhost, but when I run them in Docker, the feign can not call the service registered in eureka.
How can feign contact eureka when run in a docker container?
First, as mentioned in spring-cloud-samples/feign-eureka, this assumes eureka (from spring-cloud-samples) is running on http://localhost:8761.
Eureka has a Docker image built from this Dockerfile.
Second, check from where you want to access localhost, because the port (even if published) will be only visible in the Docker host. Depending on your OS, the docker host might not be the actual physical host, which will then require port forwarding (like here for boot2docker for instance).