title: Docker: Permissions error on OpenShift Origin 3.6
body: <p>I'm trying to run a pretty simple Flask API in OpenShift Origin 3.6. I can build this container just fine locally and remotely, but when I go to deploy on OpenShift, I get permissions errors on the <code>RUN chmod -R 777 ...</code> lines. Has anyone found a way around this? I wonder if my corporate environment doesn't allow this type of copying, but it's all within a container...</p>
  
  <p>Edit: providing a completely minimal example</p>
  
  <p>Directory structure:</p>
  
  <pre><code>project
  ├── Dockerfile
  └── app
      └── api.py
  </code></pre>
  
  <p><code>Dockerfile</code> to build base image:</p>
  
  <pre><code>FROM docker.io/ubuntu:16.04
  
  RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends \
      cmake curl git make gunicorn nginx python3 python3-pip python3-setuptools build-essential \
      &amp;&amp; apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  RUN pip3 install --upgrade pip
  RUN pip3 install pandas numpy scikit-learn scipy xgboost flask-restful nltk gunicorn
  
  RUN mkdir -p /home/app
  
  WORKDIR /
  RUN python3 -c 'import nltk; nltk.download("punkt")'
  RUN mv /root/nltk_data /home/app
  </code></pre>
  
  <p>I then run <code>docker build . -t project:latest --no-cache</code>. Next, the <code>Dockerfile</code> that uses the base image from above to deploy the actual application (I basically just comment out the "base image" lines from above and uncomment these ones from below, using the same <code>Dockerfile</code> file):</p>
  
  <pre><code>FROM project:latest
  
  COPY app /home/app
  
  RUN chmod -R 777 /home/app
  
  WORKDIR /home/app
  
  EXPOSE 5000
  
  CMD ["python3", "api.py"]
  </code></pre>
  
  <p>I build the container to be deployed using <code>docker build . -t project:app --no-cache</code>.</p>
  
  <p><code>api.py</code>:</p>
  
  <pre><code>import time
  
  if __name__ == '__main__':
      while True:
          print('This app is running')
          time.sleep(30)
  </code></pre>