title: executable file not found in $PATH Dockerfile
body: <p>I am building a Dockerfile for an application. I want to execute a bash script with parameters when the container starts to run, so I have made it an entry point. However, Docker cannot find the directory in which my script is located. Thi script is located in the Intellij Idea project folder and the path practically looks like this: <code>/home/user/Documents/folder1/folder2/folder3/Projectname/runapp.sh</code></p>
  
  <p>I have tried to mount this directory as volume, but while running built image an error occurred: </p>
  
  <pre><code>docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"runapp.sh\": executable file not found in $PATH": unknown.
  </code></pre>
  
  <p>What may be the reason of such behavior? How else can I reach this bash script from Dockerfile?</p>
  
  <p>Here is how the Dockerfile looks like:</p>
  
  <pre><code>FROM java:8
  
  ENV SCALA_VERSION 2.11.8
  ENV SBT_VERSION 1.1.1
  ENV SPARK_VERSION 2.2.0
  ENV SPARK_DIST spark-$SPARK_VERSION-bin-hadoop2.6
  ENV SPARK_ARCH $SPARK_DIST.tgz
  ENV NEO4J_CONFIG default
  ENV BENCHMARK_NAME default
  
  WORKDIR /opt
  
  # Install Scala
  RUN \
    cd /root &amp;&amp; \
    curl -o scala-$SCALA_VERSION.tgz http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz &amp;&amp; \
    tar -xf scala-$SCALA_VERSION.tgz &amp;&amp; \
    rm scala-$SCALA_VERSION.tgz &amp;&amp; \
    echo &gt;&gt; /root/.bashrc &amp;&amp; \
    echo 'export PATH=~/scala-$SCALA_VERSION/bin:$PATH' &gt;&gt; /root/.bashrc
  
  # Install SBT
  RUN \
    curl -L -o sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb &amp;&amp; \
    dpkg -i sbt-$SBT_VERSION.deb &amp;&amp; \
    rm sbt-$SBT_VERSION.deb
  
  # Install Spark
  RUN \
      cd /opt &amp;&amp; \
      curl -o $SPARK_ARCH http://d3kbcqa49mib13.cloudfront.net/$SPARK_ARCH &amp;&amp; \
      tar xvfz $SPARK_ARCH &amp;&amp; \
      rm $SPARK_ARCH &amp;&amp; \
      echo 'export PATH=$SPARK_DIST/bin:$PATH' &gt;&gt; /root/.bashrc
  
  EXPOSE 9851 9852 4040 7474 7687 7473
  
  VOLUME /home/user/Documents/folder1/folder2/folder3/Projectname /workdir1
  
  WORKDIR /workdir1
  
  ENTRYPOINT ["runapp.sh"]
  
  CMD ["$NEO4J_CONFIG", "$BENCHMARK_NAME"]
  </code></pre>