title: Springboot jar runs, but not inside Docker container
body: <p>I have recently dockerized a maven / springboot project. It runs outside docker just fine, and it even starts in a docker container, but as soon as I try to interact with the application, I receive a <code>java.lang.ClassNotFoundException</code>. </p>
  
  <p>My understanding is that this has to do with the classpath, but why would the jar run locally and not in the docker container?</p>
  
  <p>The class that is missing belongs to an external jar file that is in the project directory structure and listed in the pom.xml as a dependency:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;externalJar&lt;/groupId&gt;
          &lt;artifactId&gt;externalJar&lt;/artifactId&gt;
          &lt;version&gt;0.0.1&lt;/version&gt;
          &lt;scope&gt;system&lt;/scope&gt;
          &lt;systemPath&gt;${project.basedir}/src/main/resources/library/externalJar.jar&lt;/systemPath&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Here is my dockerfile:</p>
  
  <pre><code>FROM openjdk:8-alpine
  
  RUN apk update &amp;&amp; apk add bash
  
  RUN mkdir -p /opt/app
  ENV PROJECT_HOME /opt/app
  
  COPY target/main.jar $PROJECT_HOME/main.jar
  
  WORKDIR $PROJECT_HOME
  EXPOSE 8282
  
  CMD ["java", "-Djava.security.egd=file:/dev/./urandom","-jar","./main.jar"]
  </code></pre>
  
  <p>What am I missing?</p>