2

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

但是,当我断开并重新连接我的容器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. 

我也尝试在主机上安装网络驱动器,并将其安装在容器中。 但搬运工人,撰写不能把它(访问的问题?):

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 

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

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

泊坞版本:

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 
+1

共享仅存在于您创建的用户会话中,其他用户或其他会话将不会看到它。它在桌面上以相同的方式工作。尝试使用$ session对象代替'PS C:\> $ session = New-PSSession -ContainerId(get-Container ed).ID -RunAsAdministrator PS C:\> Invoke-Command -Session $ session -Command {$ env :mytest =“test”} PS C:\> Invoke-Command -Session $ session -Command {Write-Output $ env:mytest} test' –

+0

@GSA感谢您的输入。想想我会尝试使用CMDKEY向用户添加凭据,并使用UNC路径。将发布结果。 –

+0

什么是您的业务与容器和必要性让用户登录到控制台上的容器? –

回答

0

另一种解决方案是挂载卷时,你在泊坞窗文件建立自己的图片。