Docker 上的 Azure CosmosDB 模拟器不生成证书

标签 azure docker azure-cosmosdb

我尝试按照以下说明在 Docker 容器中运行 Azure CosmosDB 模拟器:

https://learn.microsoft.com/en-us/azure/cosmos-db/local-emulator#running-on-docker

描述的主要命令是:

md %LOCALAPPDATA%\CosmosDBEmulatorCert 2>null docker run -v %LOCALAPPDATA%\CosmosDBEmulatorCert:C:\CosmosDB.Emulator\CosmosDBEmulatorCert -P -t -i -m 2GB microsoft/azure-cosmosdb-emulator

下一条指令是在主机上导入 SSL 证书: cd/d %LOCALAPPDATA%\CosmosDBEmulatorCert powershell .\importcert.ps1

但是该文件夹是空的 - 没有证书,也没有 powershell 脚本。

同样,容器上的 C:\CosmosDB.Emulator\CosmosDBEmulatorCert 文件夹也是空的。

当一切都初始化时,有一行内容:

-a---- 10/18/2018 4:50 PM 513 CosmosDbEmulatorCert.cer

但我在任何地方都看不到证书

最佳答案

请改用以下说明: https://hub.docker.com/r/microsoft/azure-cosmosdb-emulator/

run 命令显示略有不同。它使用 --mount而不是-v处理卷和绑定(bind)的选项:

(将 %hostDirectory% 替换为您要存储证书(如 C:\Users\<youruser>\AppData\Local\azure-cosmosdb-emulator-hostd )的路径,或在脚本中声明它)

 docker run --name azure-cosmosdb-emulator --memory 2GB --mount "type=bind,source=%hostDirectory%,destination=C:\CosmosDB.Emulator\bind-mount" -P --interactive --tty microsoft/azure-cosmosdb-emulator

然后您可以关闭交互式 shell。它将继续运行。

关于Docker 上的 Azure CosmosDB 模拟器不生成证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52878415/

相关文章:

sql - Azure数据工厂: trivial SQL query in Data Flow returns nothing

azure - 从图表中查找路径,然后使用 Gremlin 计算路径在 Azure Cosmos DB 中出现的次数

文件系统为 xfs 且存储驱动程序覆盖时 Docker 卷映射文件损坏

c# - Cosmos DB - Mongo API - 文档不包含分片键

azure-cosmosdb - DocumentDb - 查询嵌套文档和根级别

c# - Application Insights - 服务器没有显示任何数据

c# - 如何在 C# 中的 azure 认知搜索结果中返回 search.score

azure - 检索多个 secret 值 key 保管库

docker - docker 1.6.0后宿主机容器的rootfs在哪里

heroku - 自定义buildpack中的权限被拒绝