title: Unable to get Configuration from Spring Cloud Config Server while its running within a Docker Container
body: <p>I have been working on trying to resolve this issue for a day, and have had no luck, I am really stumped on what the error is. I have created a simple Spring Cloud Config Server using Spring Boot version 1.5.9.RELEASE and Spring Cloud Edgware.RELEASE. My Config Repo is a bitbucket repository. For Docker I am using the fabric8 maven docker plugin to build the docker image, and its deployed on Docker for Mac. I am also using Java 9. I am able to build my docker image, and run it on port 8888 but when I invoke the health endpoint it is "Down". When I try to run the following Get Request (<a href="http://localhost:8888/sample-api/dev" rel="nofollow noreferrer">http://localhost:8888/sample-api/dev</a>), I get the following error:</p>
  
  <pre><code>{
      "timestamp": 1515552923667,
      "status": 404,
      "error": "Not Found",
      "exception": "org.springframework.cloud.config.server.environment.NoSuchRepositoryException",
      "message": "Cannot clone or checkout repository: https://bitbucket.org/&lt;project&gt;/&lt;repo&gt;.git",
      "path": "/sample-api/dev"
  }
  </code></pre>
  
  <p>Below is my Dockerfile, any sensitive data has been removed</p>
  
  <pre><code>FROM openjdk:9
  ENV PROFILE dev
  VOLUME /config
  ADD /maven/*.jar app.jar
  EXPOSE 8888
  RUN bash -c 'touch /app.jar'
  WORKDIR /
  ENTRYPOINT exec java -Dspring.profiles.active=$PROFILE -Djava.security.egd=file:/dev/./urandom -jar /app.jar
  </code></pre>
  
  <p>Below is my application yaml file:</p>
  
  <pre><code>server:
    port: 8888
  spring:
    application:
      name: sample-config-server
    cloud:
      config:
        server:
          encrypt:
            enabled: false
          git:
            uri: https://bitbucket.org/&lt;project&gt;/&lt;repo&gt;.git
            username: ${GIT_USER_NAME}
            password: ${GIT_PASSWORD}
  
  username: ${CLOUD_CONFIG_NAME}
  password: ${CLOUD_CONFIG_PASSWORD}
  </code></pre>
  
  <p>Below are the commands I use to run this with docker:</p>
  
  <pre><code>mvn clean package docker:build
  docker run -p 8888:8888 -d sample/&lt;sample-config-server:latest
  </code></pre>
  
  <p>When I run locally using,  mvn -Dspring.profiles.active=dev spring-boot:run, everything works as expected. It is only when I run within Docker for Mac when I get the 404 error. I tried sshing into the container and cloning my git repo manually, I was able to do that with no problem. The issue has to be with my Spring Cloud configuration or even Spring Cloud Config Project itself, I don't know.</p>
  
  <p>Has anyone faced this issue before? Can anyone replicate this issue?</p>
  
  <p>Update:</p>
  
  <p>I have run the same container in minikube and I still get this same issue... I am working round the clock trying to resolve this issue, but no success yet. I will keep you updated.</p>