我试图让Docker for Windows上运行的Cosmos数据库模拟器,但我没有任何运气。我在这里以下命令:如何在Docker for Windows上运行Cosmos数据库模拟器?
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
我从码头工人得到的各种错误,包括 “无效的绑定安装”。该命令本身似乎并不正确,所以我试图将mominag/documentdb_emulator
更改为microsoft/azure-documentdb-emulator
,但该功能无效。 这并不意味着这是我第一次尝试使用Docker。
我也看了一下GitHub上的以下内容,它们看起来像是Microsoft文档中命令的来源。
https://github.com/Azure/azure-documentdb-emulator-docker
UPDATE: 这里是我运行的命令和返回的错误。
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
创建目录,但我还是坐上泊坞窗运行命令相同的错误。
我刚刚做到了,它工作得很好。原始命令和'microsoft/azure-documentdb-emulator'都能正常工作,您是否将docker切换到Windows模式\容器? – 4c74356b41
我没有切换到Windows容器,但我刚刚做了,但仍然出现错误。我将用特定的错误消息更新问题。 – user1843640
我会建议删除所有的虚拟网络和安装docker从零开始 – 4c74356b41