Technical Reference:
https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-2.2
https://docs.docker.com/docker-for-windows/install/
System Requirements
Windows 10 64 Bit: Professional Edition, Enterprise Edition or Education Edition (build 15063 or later).
You must enable Hyper-V and Containers Windows functions.
To successfully run on Client Hyper-V Windows 10, you need the following hardware prerequisites:
Having two 64-bit processor address translation (SLAT) of
4GB of system memory
BIOS must be enabled in the BIOS setup stage hardware virtualization support. For more information, see virtualization.
Download example: https: //github.com/dotnet/dotnet-docker
Navigate to dotnet-docker / samples / aspnetapp / aspnetapp project folder under
Run the following command to generate and run the application locally: dotnet run
In the browser, go to http: // localhost: 5000 to test the application
In the Docker client, switch to the Windows container
Run the following commands to build and run the sample in Docker:
docker build -t aspnetapp .
docker run -it --rm --name aspnetcore_sample aspnetapp
For Windows vessel, IP address, you need a container (the browser to http: // localhost: 5000 will not work):
Open another command prompt.
Run docker ps to view the container is running. To verify that it contains the "aspnetcore_sample" container.
Run docker exec aspnetcore_sample ipconfig to display the container's IP address. The output of the command shown in the following example:
Navigate to dotnet-docker / samples / aspnetapp / aspnetapp project files in the folder.
dotnet publish -c Release -o published
dotnet published\aspnetapp.dll