title: Docker user permission while mounting a directory
body: <p>I am using the following Dockerfile to build Solr using Docker.</p>
  
  <pre><code>FROM solr:5.5
  ENV SOLR_HOME=/opt/solr/server/solr/cores
  RUN mkdir ${SOLR_HOME}
  RUN chown -R solr:solr ${SOLR_HOME}
  VOLUME ["${SOLR_HOME}"]
  EXPOSE 8983
  </code></pre>
  
  <p>I try to run the following Docker command to mount a host directory to the container:</p>
  
  <pre><code>docker run --restart=always -d --name solr-demo \
  --privileged=true -p 8983:8983 \
  -v /data/solr_demo:/opt/solr/server/solr/cores \
  solr-test:latest
  </code></pre>
  
  <p>I  am also copying the required <code>solr.xml</code> file into the <code>data/solr_demo</code>. When I run the <code>docker run</code> command I get the following error:</p>
  
  <pre><code>stat: cannot stat ‘/opt/solr/server/solr/cores’: No such file or directory 42146d74b446ba4784fd197688e3210f294aad8755ae730cc559132720bcc35a
  Error response from daemon: Container 42146d74b446ba4784fd197688e3210f294aad8755ae730cc559132720bcc35a is restarting, wait until the container is running
  </code></pre>