title: Netflix-zuul can't route spring boot microservice api in docker
body: <p>I'm getting "<a href="https://imgur.com/USYfFM4.jpg" rel="nofollow noreferrer">There was an unexpected error (type=Internal Server Error, status=500) GENERAL</a>" error when i deploy my zuul-gateway-service in docker container and test it. But in windows, when i run applications in eclipse, everything is working just fine, i can reach services via zuul gateway port and i can also use every mapping with postman through gateway. But it doesnt work in docker containers.</p>
  
  <p>ZuulGatewayServerApplication.java ;</p>
  
  <pre><code>@EnableEurekaClient
  @EnableZuulProxy
  @SpringBootApplication
  @EnableDiscoveryClient
  public class ZuulGatewayServerApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ZuulGatewayServerApplication.class, args);
      }
  }
  </code></pre>
  
  <p>application.properties file for zuul-gateway-service; </p>
  
  <pre><code>server.port=8762
  spring.application.name=t-zuul-server
  eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka
  
  zuul.ignored-services=*
  
  zuul.routes.t-author-bookstore.path=/author/**
  zuul.routes.t-author-bookstore.service-ıd=t-author-bookstore
  #zuul.routes.t-author-bookstore.strip-prefix=false
  
  zuul.routes.t-book-bookstore.path=/book/**
  zuul.routes.t-book-bookstore.service-ıd=t-book-bookstore
  #zuul.routes.t-book-bookstore.strip-prefix=false
  #... there is also 4 more services
  </code></pre>
  
  <p>I also tried to add those codes in application.properties file for zuul-gateway-service;</p>
  
  <pre><code>eureka.client.registerWithEureka = true
  eureka.client.register-with-eureka=true
  ribbon.eureka.enabled=true
  zuul.routes.${service_name}.strip-prefix=false
  </code></pre>
  
  <p>In docker, for zuul-gateway-service, my Dockerfile is like this</p>
  
  <pre><code>FROM openjdk:8-alpine
  VOLUME /tmp
  COPY t-zuul-gateway-server-1.0.jar t-zuul-app.jar
  EXPOSE 8762
  ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/t-zuul-app.jar"]
  </code></pre>
  
  <p>This is how i start docker images</p>
  
  <pre><code>docker run -d --network=bookstore-mongodb -p 8761:8761 --name t-eureka-server t-eureka-server-1.0
  docker run -d --network=bookstore-mongodb -p 8762:8762 --name t-zuul-servicee --link=mongo --rm -e EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://localhost:8761/eureka t-zuul-gateway-server-1.0
  docker run -d --network=bookstore-mongodb -p 8052:8052 --name t-book-bookstore --link=mongo --rm -e EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://localhost:8761/eureka t-book-bookstore-1.0
  </code></pre>
  
  <p>Port 8052 is working as expected.</p>
  
  <p>This is how my docker container processes looks (docker ps): <a href="https://i.imgur.com/MTaB2WO.png" rel="nofollow noreferrer">here</a></p>
  
  <p>I also tried to link zuul-gateway-service with other containers --link. But it didn't work.</p>
  
  <p>Same codes are working fine in windows but not in docker containers. I expect to connect the gateway with services in docker containers. Thanks for any hits.</p>