title: docker run error: Unable to access jarfile
body: <p>Docker image is built but when I want to run it, it shows this error: </p>
  
  <pre><code>Error: Unable to access jarfile rest-service-1.0.jar
  </code></pre>
  
  <p>My OS is Ubuntu 18.04.1 LTS and I use docker build -t doc-service &amp; docker run doc-service.  </p>
  
  <p>This is my Dockerfile:</p>
  
  <pre><code>FROM ubuntu:16.04
  
  MAINTAINER Frederico Apostolo &lt;frederico.apostolo@blockfactory.com&gt; (@fapostolo)
  
  RUN apt-get update &amp;&amp; apt-get -y upgrade
  
  RUN apt-get install -y software-properties-common python-software-properties language-pack-en-base
  
  RUN add-apt-repository ppa:webupd8team/java
  
  RUN apt-get update &amp;&amp; apt-get update --fix-missing &amp;&amp; apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages upgrade \
      &amp;&amp; echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections \
      &amp;&amp; apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages curl vim unzip wget oracle-java8-installer \
      &amp;&amp; apt-get clean &amp;&amp; rm -rf /var/cache/* /var/lib/apt/lists/*
  
  ENV JAVA_HOME /usr/lib/jvm/java-8-oracle/
  
  run java -version
  run echo $JAVA_HOME
  
  #use locate for debug
  RUN apt-get update &amp;&amp; apt-get install -y locate mlocate &amp;&amp; updatedb
  
  #LIBREOFFICE START
  RUN apt-get update &amp;&amp; apt-get update --fix-missing &amp;&amp; apt-get install -y -q libreoffice \
      libreoffice-writer ure libreoffice-java-common libreoffice-core libreoffice-common \
      fonts-opensymbol hyphen-fr hyphen-de hyphen-en-us hyphen-it hyphen-ru fonts-dejavu \
      fonts-dejavu-core fonts-dejavu-extra fonts-noto fonts-dustin fonts-f500 fonts-fanwood \
      fonts-freefont-ttf fonts-liberation fonts-lmodern fonts-lyx fonts-sil-gentium \
      fonts-texgyre fonts-tlwg-purisa
  #LIBREOFFICE END
  
  #font configuration
  COPY 00-odt-template-renderer-fontconfig.conf /etc/fonts/conf.d
  
  RUN mkdir /document-service /document-service/fonts /document-service/module /document-service/logs
  
  # local settings
  RUN echo "127.0.0.1       http://www.arbs.local http://arbs.local www.arbs.local arbs.local" &gt;&gt; /etc/hosts
  # &amp;&amp; mkdir /logs/ &amp;&amp; echo "dummy" &gt;&gt; /logs/errors.log
  
  #EXPOSE 2115
  
  COPY document-service-java_with_user_arg.sh /
  RUN chmod +x /document-service-java_with_user_arg.sh
  
  RUN apt-get update &amp;&amp; apt-get -y --no-install-recommends install \
      ca-certificates \
      curl
  
  RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
  RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.4/gosu-$(dpkg --print-architecture)" \
      &amp;&amp; curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.4/gosu-$(dpkg --print-architecture).asc" \
      &amp;&amp; gpg --verify /usr/local/bin/gosu.asc \
      &amp;&amp; rm /usr/local/bin/gosu.asc \
      &amp;&amp; chmod +x /usr/local/bin/gosu
  
  ENV LANG="en_US.UTF-8"
  
  # In case someone loses the Dockerfile
  # Needs to be in the end so it doesn't invalidate unaltered cache whenever the file is updated.
  RUN rm -rf /etc/Dockerfile
  ADD Dockerfile /etc/Dockerfile
  
  ENTRYPOINT ["/document-service-java_with_user_arg.sh"]
  
  this is document-service-java_with_user_arg.sh:
  
  #!/bin/bash
  
  USER_ID=${LOCAL_USER_ID:-9001}
  USER_NAME=${LOCAL_USER_NAME:-jetty}
  
  echo "Starting user: $USER_NAME with UID : $USER_ID"
  useradd --shell /bin/bash --home-dir /document-service/dockerhome --non-unique --uid $USER_ID $USER_NAME
  
  cd /document-service
  
  /usr/local/bin/gosu $USER_NAME "$@" java -jar rest-service-1.0.jar
  </code></pre>
  
  <p>Can anyone help me on this?</p>