2

我想在 Windows 容器中挂载文件共享。我尝试挂载 Azure 文件存储共享,最初它工作正常。我可以浏览目录中的文件。

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

    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.

我还尝试将网络驱动器安装在主机上,并将其安装在容器中。但是 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 Volume 驱动程序。)

更多信息:我在具有 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
4

1 回答 1

0

另一种解决方案是在 docker 文件中构建图像时挂载卷。

于 2017-07-18T14:26:36.603 回答