Within Windows:
Make a vs2017 (15.8 version) new. NET Core Project ASP. Project template ASP. core2.1 No Docker support (because Docker support under Windows is a hassle) HTTPS is on, but when it is released to Linux by default, it seems to be HTTP at last;
New project WebApplication1, commissioning words
Https://localhost:5001/api/values will return a JSON file content is
["Value1", "value2"];
Publish (new configuration file):
Publish method: Select File system;
Settings: Release;
Target frame: I am netcoreapp2.1 for the time being;
Deployment mode: Choose Independent, published, the overall document more, larger, I am currently measured is probably 93mb+;
Select frame depends on, publish, the overall file number is very small, measured less than 2MB large;
Because it is released to centos7.x Docker so the target movement: linux-x64;
Publish the default file under Project folder \bin\release\netcoreapp2.1\publish
Linux:
Package the files under Windows Publishing directory Publish, transfer them to Linux, and unzip them to/dotnet;
Deployment Mode Select Standalone:
chmod U+x/dotnet/webapplication1
Docker run-dit--restart=always--name=dotnet-p 80:80-v/dotnet:/dotnet--hostname dotnet microsoft/dotnet:2.2-runtime /dotnet/webapplication1;
Microsoft/dotnet:2.2-runtime image size 180.5MB;
Plus the project document 93mb+, a total of 273mb+ large;
Deployment mode Selection Framework dependencies:
Docker run-dit--restart=always--name=dotnet-p 80:80-v/dotnet:/dotnet--hostname dotnet microsoft/dotnet:2.2-aspnetc Ore-runtime dotnet/dotnet/WebApplication1.dll;
Microsoft/dotnet:2.2-aspnetcore-runtime image size 257.8MB;
Plus project Document 2mb-, a total of 259mb large;
My advice is to choose the second way, the package is relatively small oh, and I saw vs2017 to add to the project Docker support Dockerfile from the bottom package, is aspnetcore-runtime;
centos7.x Docker Run ASP. NET core2.x Project