title: Docker and remote volumes
body: <p>I'm a docker beginner and have a problem with volumes residing on a NAS.</p>
  
  <p>The connection to the shares is working fine. With both SMB and NFS, I could mount the shares to the docker host using the following entries in fstab</p>
  
  <pre><code>&lt;IP of the NAS&gt;:/volume1/sharenfs /nas/nfs nfs _netdev,bind 0 0
  //&lt;IP of the NAS&gt;/sharesmb /nas/smb cifs _netdev,bind,credentials=/root/.cifs-credentials,iocharset=utf8,vers=3.0,uid=0,gid=0 0 0
  </code></pre>
  
  <p>Creating directories and files via the Docker Host works fine. However, as soon as I start a container and create data on the shares, it only works conditionally. For example, <code>portainer/portainer</code> works without any limitations, but <code>kempkensteffen/usvn</code> or <code>yobasystems/alpine-mariadb</code> won't work as expected. During setup of <code>usvn</code> there are missing permantent write permissions on the config volume.</p>
  
  <p>In the Docker documentation it says that instead of direct paths Docker Volumes should be used. So I created the volumes as documented:</p>
  
  <pre><code>docker volume create \
      --driver local \
      --opt type=nfs \
      --opt o="vers=4,addr=&lt;IP of NAS&gt;,rw" \
      --opt device=:&lt;Path on NAS&gt; \
      v_portainer
  </code></pre>
  
  <p>and</p>
  
  <pre><code>docker volume create \
      --driver local \
      --opt type=cifs \
      --opt o=addr=&lt;IP of NAS&gt;,rw \
      --opt device=//&lt;IP of NAS&gt;/&lt;Share on NAS&gt; \
      --opt o=uid=0,username=&lt;smbuser&gt;,password=&lt;smbpassword&gt;,nounix,file_mode=0770,dir_mode=0770 \
      v_portainer
  </code></pre>
  
  <p>So I removed the fstab entries and created the volumes with the given syntax. But this results also in the same effect - <code>portainer</code> works, but the others won't. Now I am quite helpless and grateful for every tip. Note: I've tested both, <code>NFS</code> and <code>CIFS</code> without success.</p>
  
  <p>The environment consists of:</p>
  
  <ul>
  <li>Docker Host OS: Alpine Linux 3.8.2 (Currently running in a VirtualBox VM)  </li>
  <li>Docker Version: 18.06.1-ce</li>
  <li>NAS: Share with NFS and NFS4 or CIFS with SMB3</li>
  </ul>