Documenting the approximate steps of. NET core deployment on Docker is easy to review later.
Part 1. NET core Web API Demo
1. Download the latest vs Community Community edition free to use.
2. Install Microsoft. NET Core Tools (Preview 2)
3. New Project->. NET core, ASP. NET Core WEB Application
4.program.cs
5. Compile start, address port number can be accessed via browser
6.dotnet Publish
Part 2 deploying. NET Core Demo to Dokcer
1.windows Installing Docker through Toolbox
2.double Click Quick Start icon
Set Docker image source to Aliyun
3. Make sure Docker is working properly. By command Docker Run-it Hello-world
3. On the basis of Part 1, locate the directory after publish add Dockerfile file
Never understood why the run Cd/root command, because it is clearly the Windows system to the/root directory?
After executing the command: Docker run-it microsoft/dotnet After the image is started it is a Linux system
4. Perform Docker build-t Webapi in the Dockerfile directory just now.
This step is to build the image
5. After the mirroring is built, boot the image via Docker run-it-p 2569:2569--name Webapi Webapi
6. Accessing virtual machine ip+ port number via browser to access the program you just deployed
. NET Core Demo & Docker images