title: No such file or directory in docker build
body: <p>I am new to docker and attempting to port an app over to it. Essentially, on startup, the app needs to perform some environment dependent work which I have encapsulated in a script.</p>
  
  <p>My app looks like</p>
  
  <pre><code>Dockerfile
  scripts/run.sh
  build-development/stuff
  build-production/stuff
  </code></pre>
  
  <p>Here is my Dockerfile:</p>
  
  <pre><code>FROM nginx
  RUN chmod +x scripts/run.sh
  CMD ["scripts/run.sh", APP_ENV]
  EXPOSE 80
  </code></pre>
  
  <p>and here is scripts/run.sh:</p>
  
  <pre><code>#!/bin/bash
  
  mkdir dist
  
  chmod -R 777 dist
  
  if [ $1 == "development" ]
  then
      cp -R build-development/. /usr/share/nginx/html
  fi
  
  if [ $1 == "stage" ]
  then
      cp -R build-production/. /usr/share/nginx/html
      sed -i 's/production/stage/g' dist/index.html
  fi
  
  if [ $1 == "production" ]
  then
      cp -R build-production/. /usr/share/nginx/html
  fi
  </code></pre>
  
  <p>The idea is that I will run the image like:</p>
  
  <pre><code>docker run -e APP_ENV=development app-name
  </code></pre>
  
  <p>and it will be fed into the script, which will copy the correct files.</p>
  
  <p>Unfortunately, I never get to run the image because during the build step:</p>
  
  <pre><code>docker build -t app-name .
  </code></pre>
  
  <p>I get errors about </p>
  
  <blockquote>
    <p>scripts/run.sh not being a file or directory</p>
  </blockquote>
  
  <p>I don't understand why I am getting this error, I guess it is from naive misunderstanding on my part. What am I doing wrong and how can I make my project work?</p>
  
  <p>Thanks in advance.</p>