【发布时间】:2017-05-14 16:30:46
【问题描述】:
我正在尝试让 Cosmos DB Emulator 在 Docker for Windows 上运行,但我没有任何运气。我在这里遵循命令:
https://docs.microsoft.com/en-us/azure/documentdb/documentdb-nosql-local-emulator
具体来说:
md %LOCALAPPDATA%\DocumentDBEmulatorCert 2>nul
docker run -v %LOCALAPPDATA%\DocumentDBEmulatorCert:c:\DocumentDBEmulator\DocumentDBEmulatorCert -P -t -i mominag/documentdb_emulator
我从 Docker 收到各种错误,包括“无效绑定挂载”。该命令本身似乎不正确,因此我尝试将 mominag/documentdb_emulator 更改为 microsoft/azure-documentdb-emulator 但这没有奏效。 这是我第一次真正尝试使用 Docker。
我还在 GitHub 上查看了以下内容,它看起来像是 Microsoft 文档中命令的来源。
https://github.com/Azure/azure-documentdb-emulator-docker
更新: 这是我正在运行的命令和返回的错误。
PS C:\> md %LOCALAPPDATA%\DocumentDBEmulatorCert 2>nul
out-file : FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:',
call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr.
At line:1 char:1
+ md %LOCALAPPDATA%\DocumentDBEmulatorCert 2>nul
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], NotSupportedException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
PS C:\> docker run -v %LOCALAPPDATA%\DocumentDBEmulatorCert:c:\DocumentDBEmulator\DocumentDBEmulatorCert -P -t -i docume
ntdb_emulator
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: invalid bind mount spec "%LOCALAPPD
ATA%\\DocumentDBEmulatorCert:c:\\DocumentDBEmulator\\DocumentDBEmulatorCert": invalid volume specification: '%LOCALAPPDA
TA%\DocumentDBEmulatorCert:c:\DocumentDBEmulator\DocumentDBEmulatorCert'.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
PS C:\>
如果我删除 2>nul 目录会创建,但我仍然在 docker run 命令上遇到同样的错误。
【问题讨论】:
-
我刚做了,效果很好。原始命令和
microsoft/azure-documentdb-emulator都运行良好,您是否将 docker 切换到 Windows 模式\容器? -
我没有切换到 Windows 容器,但我刚刚切换了,但仍然出现错误。我将使用特定的错误消息更新问题。
-
我建议删除所有虚拟网络并从头开始安装 docker
标签: azure docker azure-cosmosdb