我想在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.
谁知道我怎么能做到这一点?
1 回答
在Windows操作系统上创建ASP.NET Core 2网站之前,右键单击系统托盘中的Docker图标,然后单击
Switch to Linux containers
. 切换到Linux容器后,创建可以在Linux上托管的ASP.NET Core网站 .