title: Network storage (SMB/CIFS) in Windows Docker
body: <p>I am trying to map an SMB network storage to Docker, in a development environment, to make it available to containers, in the same way as a shared local drive. This means, for the entire Docker VM, not individual containers. Another application needs the network storage through SMB access, but is in another domain, so I can't share anything from my local drives to it. Windows network drives also don't work with Docker.</p>
  
  <p>The current workaround is to open nested shells on Docker, to access the VM and then mount the network storage. I tried this as a Windows batch file, but it stops at the first shell prompt and does not input anymore via "echo".</p>
  
  <pre><code>docker run --rm -it --privileged --pid=host justincormack/nsenter1
  echo ctr -n services.linuxkit task exec -t --exec-id foo docker-ce /bin/sh
  echo mkdir host_mnt/mystorage
  echo mkdir host_mnt/mystorage/Videos
  echo mkdir host_mnt/mystorage/Videos/my-private-storage
  echo mount -v -t cifs -o username=myname,password=p@s$w0rd,file_mode=0777,dir_mode=0777,vers=2.0,uid=1234,gid=1234 //mystorage.mycompany.com/Videos/my-private-storage /host_mnt/mystorage/Videos/my-private-storage
  echo exit
  echo exit
  </code></pre>
  
  <p>Typing this into the console (without the "echo"s) requires deletion/restart of Docker containers afterwards.</p>
  
  <p>Is there any way to map a network drive to Docker easily and upon Docker startup? Or any other way to easily use an SMB resource?</p>