Docker for windows – 文件共享

我想要在Windows容器中安装文件共享。 我试图安装一个Azure文件存储共享,并在内部工作正常。 我可以浏览目录中的文件。

但是,当断开连接并重新连接我的容器powershell会话时,共享标记为“不可用”。 此外,该共享不可用于作为我的入口点运行的可执行文件。

docker exec -it a4 powershell ************** PS C:\> net use z: \\XXXX.file.core.windows.net\dockerstore /u:XXXXX XXXXXX== /P:Yes The command completed successfully. PS C:\> net use New connections will be remembered. Status Local Remote Network ------------------------------------------------------------------------------- OK Z: \\XXXX.file.core.windows.net\dockerstore Microsoft Windows Network The command completed successfully. exit ****************** docker exec -it a4 powershell ********************** PS C:\> net use New connections will be remembered. Status Local Remote Network ------------------------------------------------------------------------------- Unavailable Z: \\XXXX.file.core.windows.net\dockerstore Microsoft Windows Network The command completed successfully. 

我也尝试在主机上安装networking驱动器,并将其安装在容器中。 但是docker-compose无法启动(访问问题?):

 Cannot create container for service configserver-c: invalid bind mount spec "z:\\Certificates:c:\\Certificates:rw": invalid volume specification: 'z:\Certificates:c:\Certificates:rw': invalid mount config for type "bind": bind source path does not exist 

是否有其他选项持久地安装外部文件共享? (我不知道任何可用于Windows的Docker音量驱动程序。)

一些更多的信息:我在Windows 10上使用Docker for Windows和Hyper-V隔离。

Docker版本:

  Client: Version: 17.03.1-ce API version: 1.27 Go version: go1.7.5 Git commit: c6d412e Built: Tue Mar 28 00:40:02 2017 OS/Arch: windows/amd64 Server: Version: 17.03.1-ce API version: 1.27 (minimum version 1.24) Go version: go1.7.5 Git commit: c6d412e Built: Tue Mar 28 00:40:02 2017 OS/Arch: windows/amd64 Experimental: true 

另一个解决scheme是在Docker文件中构build图像时挂载音量。