【发布时间】:2021-05-11 14:04:35
【问题描述】:
我需要一个使用特定自定义 url 运行的 docker 容器。
需要如下:
localhost:9000/sample/
我已经在我的 launchsettings.json 文件中定义了这个:
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/sample/",
"publishAllPorts": true,
"httpPort": 9000
}
但是当我运行容器并在浏览器中启动它时,它总是会遗漏“样本”,看起来像这样:
localhost:9000
我尝试在 launchsettings.json 中使用以下内容:
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "http://localhost:9000/sample/",
"publishAllPorts": true,
"httpPort": 9000
}
但它仍然只使用 localhost:9000 启动
我在这里错过了什么?
我正在使用 Visual Studio 2019。
【问题讨论】:
-
尝试在
Run With>Custom Configuration > Run Action --> Debug .Net Core Debugger更改启动网址
标签: docker asp.net-core docker-desktop