I'm trying to get Cosmos DB Emulator running on Docker for Windows but I am not having any luck. I am following the commands here:
https://docs.microsoft.com/en-us/azure/documentdb/documentdb-nosql-local-emulator
Specifically:
md %LOCALAPPDATA%\DocumentDBEmulatorCert 2>nul
docker run -v %LOCALAPPDATA%\DocumentDBEmulatorCert:c:\DocumentDBEmulator\DocumentDBEmulatorCert -P -t -i mominag/documentdb_emulator
I am getting various errors from Docker including "invalid bind mount". The command itself doesn't seem right so I've tried changing mominag/documentdb_emulator
to microsoft/azure-documentdb-emulator
but that has not worked. It doesn't help that this is my first real attempt at using Docker.
I also took a look at the following on GitHub which looks like the source of the commands in the Microsoft docs.
https://github.com/Azure/azure-documentdb-emulator-docker
UPDATE: Here are the commands I am running and the errors that are returned.
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:\>
If I remove the 2>nul
the directory is created but I still get the same error on the docker run command.
microsoft/azure-documentdb-emulator
worked fine, did you switch docker to windows mode\containers? – 4c74356b41