ubuntu@ip-172-31-16-20:~$ sudo docker run --rm -it microsoft/dotnet root@b2ce07e9f5e5:/# dotnet new mvc -n docker.web The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully. This template contains technologies from parties other than Microsoft, see https://aka.ms/template-3pn for details.
Processing post-creation actions... Running 'dotnet restore' on docker.web/docker.web.csproj... Restoring packages for /docker.web/docker.web.csproj... Generating MSBuild file /docker.web/obj/docker.web.csproj.nuget.g.props. Generating MSBuild file /docker.web/obj/docker.web.csproj.nuget.g.targets. Restore completed in 1.69 sec for /docker.web/docker.web.csproj. Restoring packages for /docker.web/docker.web.csproj... Restore completed in 338.5 ms for /docker.web/docker.web.csproj.
Restore succeeded.
root@b2ce07e9f5e5:/# cd docker.web root@b2ce07e9f5e5:/docker.web# dotnet run warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {392f49bb-6372-47a0-a34b-94b82a079812} may be persisted to storage in unencrypted form. warn: Microsoft.AspNetCore.Server.Kestrel[0] Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Error -99 EADDRNOTAVAIL address not available'. Hosting environment: Production Content root path: /docker.web Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down.
ubuntu@ip-172-31-16-20:~$ sudo docker run --rm -it \ > -v $HOME/dotnet/docker.web:/app \ > microsoft/dotnet:latest root@4e0ae54991c4:/# ls app boot etc lib media opt root sbin sys usr bin dev home lib64 mnt proc run srv tmp var root@4e0ae54991c4:/# cd app root@4e0ae54991c4:/app# ls Controllers Startup.cs appsettings.json docker.web.csproj Models Views bin obj Program.cs appsettings.Development.json bundleconfig.json wwwroot root@4e0ae54991c4:/app# dotnet run warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {3600e0ea-f9cc-4c43-b75f-58665338c060} may be persisted to storage in unencrypted form. warn: Microsoft.AspNetCore.Server.Kestrel[0] Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Error -99 EADDRNOTAVAIL address not available'. Hosting environment: Production Content root path: /app Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down.