title: docker run - Error: Unable to access jarfile
body: <p>i'm new to dockers and 
  I'm trying to run on my mac: </p>
  
  <p><strong>docker run eloomina1/datacollector</strong></p>
  
  <p>return with:</p>
  
  <blockquote>
    <p>Error: Unable to access jarfile dataCollector-0.0.1-SNAPSHOT.jar</p>
  </blockquote>
  
  <p>I've checked and it's not permissions to the file.
  I'm building the image like that:</p>
  
  <p><strong>docker build --build-arg JAR_FILE=dataCollector-0.0.1-SNAPSHOT.jar -t eloomina1/datacollector .</strong></p>
  
  <p>my dockerfile:</p>
  
  <pre><code>
      FROM adoptopenjdk/openjdk12:latest
      MAINTAINER Shahar Wider &lt;shahar@ttt.com&gt;
      VOLUME /tmp
      ARG JAR_FILE
      COPY target/${JAR_FILE} dataCollector.jar
      ENTRYPOINT ["java","-jar","dataCollector-0.0.1-SNAPSHOT.jar"]
  
  </code></pre>
  
  <p>my pom.xml:</p>
  
  <pre><code>&lt;groupId&gt;com.eloomina&lt;/groupId&gt;
  &lt;artifactId&gt;dataCollector&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;dataCollector&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;java.version&gt;12&lt;/java.version&gt;
      &lt;spring-cloud.version&gt;Greenwich.SR1&lt;/spring-cloud.version&gt;
      &lt;docker.image.prefix&gt;eloomina1&lt;/docker.image.prefix&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;unpack&lt;/id&gt;
                  &lt;phase&gt;package&lt;/phase&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;unpack&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                      &lt;artifactItems&gt;
                          &lt;artifactItem&gt;
                              &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
                              &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;
                              &lt;version&gt;${project.version}&lt;/version&gt;
                          &lt;/artifactItem&gt;
                      &lt;/artifactItems&gt;
                  &lt;/configuration&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.spotify&lt;/groupId&gt;
              &lt;artifactId&gt;dockerfile-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.4.10&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;default&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;build&lt;/goal&gt;
                          &lt;goal&gt;push&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;repository&gt;eloomina1/datacollector&lt;/repository&gt;
                  &lt;tag&gt;${project.version}&lt;/tag&gt;
                  &lt;buildArgs&gt;
                      &lt;JAR_FILE&gt;${project.build.finalName}.jar&lt;/JAR_FILE&gt;
                  &lt;/buildArgs&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>my filesystem:</p>
  
  <pre><code>├── Dockerfile
  ├── HELP.md
  ├── cd
  ├── dataCollector.log
  ├── mvnw
  ├── mvnw.cmd
  ├── pom.xml
  ├── src
  └── target
      ├── dataCollector-0.0.1-SNAPSHOT-docker-info.jar
      ├── dataCollector-0.0.1-SNAPSHOT.jar
  </code></pre>