gpt4 book ai didi

linux - 在 Windows 上的 Docker 容器中编辑 ASP.NET Core 网站并在 Ubuntu VPN 上运行

转载 作者:太空宇宙 更新时间:2023-11-04 10:07:47 25 4
gpt4 key购买 nike

我想在 docker 容器中创建一个 ASP.NET Core 2.0 网站并将其托管在 Linux VPS docker 系统上。我尝试在 Visual Studio 中创建一个 ASP.NET Core 2.0 项目,然后将其发布到 docker hub。一切都很好,直到我想在我的 Linux 环境中运行那个 docker 镜像。然后我收到一条错误消息,说这个图像是为 Windows 或类似的东西创建的。我知道我需要在 Linux 环境中创建 asp.net 项目,然后开始编码(很明显),但我想在 我的 PC 上使用 Visual Studio 进行编码,而不是通过 PICO 或一些其他的 ssh 连接的编辑器。

总结:

- I wish to run ASP.NET Core 2.0 website on Linux Docker VPS environment.
- I (think I) need to create the project in the Linux environment (I run Windows locally).
- Wish to edit the code in the docker container locally on my Windows environment.

有人知道我怎样才能做到这一点吗?

最佳答案

在您的 Windows 操作系统上创建 ASP.NET Core 2 网站之前,右键单击系统托盘中的 Docker 图标,然后单击 切换到 Linux 容器。切换到 Linux 容器后,创建可以在 Linux 上托管的 ASP.NET Core 网站。

enter image description here

关于linux - 在 Windows 上的 Docker 容器中编辑 ASP.NET Core 网站并在 Ubuntu VPN 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51106558/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com