如何解决docker卷创建中的选项不支持此平台错误

Fei*_*bow 5 windows docker

我尝试使用以下命令在 Windows Server 2019 上的映射网络目录中创建名为“cifstest”的 docker 卷:

docker volume create --driver local --opt type=cifs --opt device=//decvice-ip/folder --opt "o=username=username,password=password" cifstest

我得到了这个错误:

Error response from daemon: create cifstest: options are not supported on this platform

这是否意味着Windows不支持docker卷的选项?

我的泊坞窗版本是: Docker version 17.12.0-ce, build c97c6d6

Fei*_*bow 0

最后我找到了满足我需求的解决方案:

我创建了从容器本身到我在远程服务器中定义的 SMB 共享的 SMB 映射。

重要的!在创建 SMB 映射之前,定义连接到 SMB 的正确凭据。

$username = "remoteHost\remoteUserName"
$password = ConvertTo-SecureString "remoteHostPassword" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)
New-SmbGlobalMapping -RemotePath \\remoteHost\SMBName  -Credential $psCred -LocalPath D:
Run Code Online (Sandbox Code Playgroud)

并且不要忘记授予 SMB(在远程主机中)对每个人的完全控制共享访问权限。