title: Docker permission problems when doing volume mapping
body: <p>I want to start a Jupyter notebook in a container. The requirement is that the notebooks that are created in the container should be also available on the host machine. For this I do volume mapping:</p>
  
  <pre><code>docker run -it --rm -p 8888:8888 -v $(shell pwd):/home/jovyan/work --name=notebook jupyter/base-notebook
  </code></pre>
  
  <p>When I run the above command, I receive the following error:</p>
  
  <pre><code>docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "chdir to cwd (\"/home/jovyan/work\") set in config.json failed: permission denied". ERRO[0000] error getting events from daemon: context canceled 
  </code></pre>
  
  <p>To solve this problem temporarily, I changed the permissions of the current working directory on the host:</p>
  
  <pre><code>chmod a+rwx [current directory]
  </code></pre>
  
  <p>I thinks changing the permissions of the folders is not a good solution and there should be another problem. </p>
  
  <p>Also I have to mention that I work in a company where I do not have sudo rights and we used a shared home directory.</p>
  
  <p>Actually I have this problem with all images. For example:</p>
  
  <pre><code>docker run -it -v /net/home/abc/Desktop/:/etc ubuntu:16.04
  </code></pre>
  
  <p>returns the following error:</p>
  
  <pre><code>docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"/var/lib/docker/containers/7e62c50efab7141468a00ddefb59d55715449e05f1c516662ac1f73fabab2722/resolv.conf\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/e71d751ce8d253eafcd0dc5f41379cc4dd73da89302cfe8171becd228fba960e\\\" at \\\"/etc/resolv.conf\\\" caused \\\"lstat /var/lib/docker/aufs/mnt/e71d751ce8d253eafcd0dc5f41379cc4dd73da89302cfe8171becd228fba960e/etc/resolv.conf: permission denied\\\"\"".
  </code></pre>