title: How to change ownership/permissions to folder inside VOLUME in Dockerfile created from another image?
body: <p>I have a Dockerfile:</p>
  <pre><code>FROM jenkins/jenkins:lts-centos
  
  USER jenkins
  ENV PLUGIN_DIR=$JENKINS_HOME/plugins
  RUN mkdir $JENKINS_HOME/plugins
  
  RUN ls -aliF $JENKINS_HOME/
  </code></pre>
  <p>that results in no folder <em>plugins</em> present.</p>
  <p>The same result when <strong>root</strong> user is used.</p>
  <p>Workaround for this is to use WORKDIR:</p>
  <pre><code>FROM jenkins/jenkins:lts-centos
  
  USER jenkins
  WORKDIR $JENKINS_HOME/plugins
  RUN chown jenkins:jenkins $JENKINS_HOME/plugins
  
  RUN ls -aliF $JENKINS_HOME/
  </code></pre>
  <p>but it results in <em>plugins</em> folder to be of <em>root</em>.</p>
  <blockquote>
  <p>35539281 drwxr-xr-x 2 root    root       6 May 26 21:45 plugins/</p>
  </blockquote>
  <p>Same with user <em>root</em>:</p>
  <pre><code>FROM jenkins/jenkins:lts-centos
  
  USER root
  WORKDIR $JENKINS_HOME/plugins
  RUN chown jenkins:jenkins $JENKINS_HOME/plugins
  
  RUN ls -aliF $JENKINS_HOME/
  </code></pre>
  <blockquote>
  <p>35539493 drwxr-xr-x 2 root    root       6 May 26 21:52 plugins/</p>
  </blockquote>
  <p>The <em>jenkins/jenkins:lts-centos</em> uses $JENKINS_HOME as VOLUME.</p>
  <p>This somehow prevents creating a folder with custom ownership or permissions.</p>
  <p>Any ideas of how to fix this?</p>