title: Dockerfile build fails when running mkdir only for particular locations
body: <p>Our application is a set of docker containers, my Dockerfile looks like:</p>
  
  <pre><code>FROM jenkins/jenkins:lts
  MAINTAINER xyz
  RUN mkdir -p /opt/service
  WORKDIR /opt/service
  ARG NODE_ENV
  ENV NODE_ENV=$NODE_ENV
  COPY package.json /opt/service
  COPY package-lock.json /opt/service
  RUN npm install
  COPY . /opt/service
  CMD [ "npm", "start" ]
  </code></pre>
  
  <p>Location 1: myproject/jenkins/dockerfile - <strong>it fails to perform mkdir</strong> </p>
  
  <pre><code>mkdir: cannot create directory ‘/opt/service’: Permission denied
  The command '/bin/sh -c mkdir -p /opt/service' returned a non-zero code: 1
  </code></pre>
  
  <p>Location 2: myproject/frontend/dockerfile - <strong>the same copy of docker file builds well</strong> </p>
  
  <p>My docker-compose file ends with:</p>
  
  <pre><code>app:
    build:
      context: .
      dockerfile: jenkins/Dockerfile
  </code></pre>