title: Docker mount happens before or after entrypoint execution
body: <p>I'm building a Docker image to run my Spring Boot based application. I want to have user to be able to feed a run time properties file by mounting the folder containing application.properties into container. Here is my Dockerfile,</p>
  
  <pre><code>FROM java:8
  
  RUN mkdir /app
  RUN mkdir /app/config
  ADD myapp.jar /app/
  
  ENTRYPOINT ["java","-jar","/app/myapp.jar"]
  </code></pre>
  
  <p>When kicking off container, I run this,</p>
  
  <pre><code>docker run -d -v /home/user/config:/app/config myapp:latest
  </code></pre>
  
  <p>where <code>/home/user/config</code> contains the <code>application.properties</code> I want the jar file to pick up during run time. </p>
  
  <p>However this doesn't work, the app run doesn't pick up this mounted properties file, it's using the default one packed inside the jar. But when I <code>exec</code> into the started container and manually run the entrypoint cmd again, it works as expected by picking up the file I mounted in. So I'm wondering is this something related to how mount works with entrypoint? Or I just didn't write the Dockerfile correctly for this case?</p>