首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Docker上的Azure CosmosDB模拟器不生成证书

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

Stack Overflow用户
提问于 2018-10-19 00:17:40
回答 3查看 843关注 0票数 3

我正在尝试按照以下说明在CosmosDB容器中运行Azure Docker仿真器:

https://docs.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

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

EN

回答 3

Stack Overflow用户

发布于 2018-12-10 22:20:09

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

运行命令显示有细微的不同。它使用--mount代替-v选项来处理卷和绑定:

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

代码语言:javascript
复制
 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。它将继续运行。

票数 1
EN

Stack Overflow用户

发布于 2018-10-19 00:31:16

我在C:\CosmosDB.Emulator\bind-mount的容器里找到了证书

票数 0
EN

Stack Overflow用户

发布于 2019-02-24 06:55:30

URL - https://hub.docker.com/r/microsoft/azure-cosmosdb-emulator/上的指令运行良好。

尽管如此,我还是想建议一些改变-

第1步:

代码语言:javascript
复制
md cd $env:LOCALAPPDATA\CosmosDBEmulatorCert

docker run --name azure-cosmosdb-emulator --memory 2GB -p 8081:8081 --mount "type=bind,source=$env:LOCALAPPDATA\CosmosDBEmulatorCert,destination=C:\CosmosDB.Emulator\bind-mount" -P --interactive --tty microsoft/azure-cosmosdb-emulator

Step2:

  • 打开另一个powershell窗口并在以下命令集下运行

Set-ExecutionPolicy -Scope Process -ExecutionPolicy旁路

$env:LOCALAPPDATA\CosmosDBEmulatorCert\importcert.ps1

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Restricted策略

Step3:

  • 浏览到以下网址:

https://localhost:8081/_explorer/index.html

对于本地主机上的可访问性,您不应再收到证书错误

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52878415

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档