【问题标题】:How to debug .net Core project with Docker support, using Visual Studio on a remote docker server如何在远程 Docker 服务器上使用 Visual Studio 调试具有 Docker 支持的 .net Core 项目
【发布时间】:2018-02-03 10:11:55
【问题描述】:

类似this的问题还有很多,但我的情况略有不同。

我在 Windows 10 Pro 机器上使用 Visual Studio Enterprise 2017,dotnet Core app 2.0,其中运行 docker for windows。

我可以在本地机器的 docker 服务器上运行和调试我的应用程序,但现在我想为我当前的项目配置 Visual Studio,以便在另一个 docker 服务器上运行应用程序。

所以在实践中,我希望它使用 docker --tls -H={theotherdockerserver} build ...

,而不是运行诸如 docker run、docker build 等命令

到目前为止,我找不到任何允许我这样做的参数或配置部分。

【问题讨论】:

    标签: docker visual-studio-2017 .net-core


    【解决方案1】:

    您需要从远程服务器访问所有文件。一种方法是将代码放入 GitHub 存储库并运行命令:docker --tls -H={dockerserver} build https://github.com/{user}/{repository}.git

    Documentation for GitHub build.

    您需要没有 GitHub 存储库的选项吗?

    【讨论】:

    • 感谢您的回复。我已经这样做了,源代码可以在我的机器中(查看更多详细信息:github.com/norcino/docker-dotnet-core-api-qnap-nas)。在我的情况下,我想做的是能够在 Visual Studio 上按 F5 并调试不在我的机器上运行的容器,而是在另一个 Docker 服务器中运行。如果可能的话,我不知道如何配置 Visual Studio。
    猜你喜欢
    • 2020-02-28
    • 2018-07-27
    • 2018-10-19
    • 2017-07-11
    • 2018-07-01
    • 2019-06-27
    • 2018-07-17
    • 2018-01-20
    • 2021-12-01
    相关资源
    最近更新 更多