【问题标题】:Path of ASP.NET Core appsettings.json in Docker ContainerDocker 容器中 ASP.NET Core appsettings.json 的路径
【发布时间】:2019-01-13 20:57:17
【问题描述】:

我计划将创建的 appsettings.{env}.json 文件作为卷从主机安装到容器中。有谁知道 Docker 容器中 appsettings.json 的路径?或者如何使用 docker 命令获取路径?

我正在将带有 Windows Server Core Docker 映像的 ASP.NET Core Web 应用程序部署到 Windows Docker 容器。

我想将它用于下面的 docker 命令。

docker run -v <path-to-appsettings.json-on-host>:<path-to-appsettings.json-inside-container> <container-name>

【问题讨论】:

  • 这非常依赖于正在运行的特定图像。对此没有统一的答案。
  • @DavidMaze,我在帖子中添加了一些细节。

标签: docker docker-swarm azure-pipelines-release-pipeline


【解决方案1】:

原来这是我需要使用的命令。在使用 Windows Server Core 映像的 Windows Container 中,appsettings.json 的路径是“C:\app\appsettings.json。

docker exec -it {container id} cmd

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-04
    • 2018-11-17
    • 2021-12-03
    • 2021-07-21
    • 2016-06-30
    • 1970-01-01
    • 2020-10-06
    • 1970-01-01
    相关资源
    最近更新 更多