简体   繁体   中英

Edit ASP.NET Core website in Docker container on Windows and run on Ubuntu VPN

I want to create a ASP.NET Core 2.0 website in a docker container and host it on a Linux VPS docker system. I tried creating an ASP.NET Core 2.0 project in Visual Studio, and then publishing it to docker hub. Everything works great, until I want to run that docker image on my Linux environment. I then get an error saying that this image is created for windows or something equivalent. I know I need to create the asp.net project in the Linux environment, then start coding (obviously), but I want to do the coding in for example Visual Studio on my PC, not via PICO or some other ssh-connected editor.

Summarized:

- 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.

Anyone know how I can achieve this?

Before creating ASP.NET Core 2 website on your windows operating system, right click on the Docker icon in system tray and then click Switch to Linux containers . Once switched to Linux containers, create ASP.NET Core website that you can host on Linux.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM