title: Error while mounting host directory in Nexus Docker
body: <p>I am using the following command to run my container</p>
  
  <pre><code>docker run -d -p 9001:8081 --name nexus -v /Users/user.name/dockerVolume/nexus:/nexus-data sonatype/nexus3
  </code></pre>
  
  <p>Container starts and fail immediately. with the following logs</p>
  
  <blockquote>
    <p>mkdir: cannot create directory '../sonatype-work/nexus3/log':
    Permission denied </p>
    
    <p>mkdir: cannot create directory
    '../sonatype-work/nexus3/tmp': Permission denied</p>
    
    <p>Java HotSpot(TM)
    64-Bit Server VM warning: Cannot open file
    ../sonatype-work/nexus3/log/jvm.log due to No such file or directory</p>
  </blockquote>
  
  <p>I was following this <a href="https://hub.docker.com/r/sonatype/nexus3/" rel="nofollow noreferrer">link</a> to set it up
  I have given said permission to nexus directory.</p>
  
  <p>I also tried the following <a href="https://stackoverflow.com/questions/36405434/sonatype-nexus-docker-volume-error">SO link</a> but that didn't help me either.
  I was still getting the same error.</p>
  
  <p>Docker Version 17.12.0-ce-mac47 (21805)</p>
  
  <p>[EDIT]
  I did made changes to the ownership of my nexus folder on my host</p>
  
  <pre><code>sudo chown -R 200 ~/dockerVolume/nexus
  </code></pre>