docker-compose up -d
$ cat <<EOF > app/NetCoreDocker.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
EOF
$ cat <<EOF > app/Program.cs
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
class Program {
static void Main(string[] args) {
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args).Configure(app => {
app.Run(async (HttpContext c) => {
await c.Response.WriteAsync("Hello ASP.NET Core!\n");
});
});
}
EOF
docker exec dotnet-build dotnet restore
docker exec dotnet-build dotnet publish -c Release -o out
docker exec asp-net dotnet NetCoreDocker.dll
git clean -fdx
docker exec dotnet-build dotnet new webapp
open app/app.csproj
-
permmit local https
`dotnet dev-certs https --trust`
-
run by visual studio
docker exec dotnet-build dotnet publish -c Release -o out
docker exec asp-net dotnet app.dll
git clean -fdx