Run the asp.net core cross-platform application in Docker, dockerasp.net
Overview
Docker has been hot for a year or two, and I believe this is not a flash of technology, it is an innovation that will profoundly influence our future development, deployment, and operation of application systems (many people regard it as a very important cornerstone of devops ). The best way to learn docker is its official documentation. If you are interested, please refer to the https://www.docker.com/what-docker
I recently wrote a series of articles (https://aks.ms/office365devguide) on integration and expansion of Office 365, and the examples will also be deployed based on docker.
Preparation
Prepare the following environment for subsequent experiments:
Docker for Windows see https://docs.docker.com/docker-for-windows/ and https://docs.docker.com/docker-for-windows/install/
Microsoft. NET Core SDK, please refer to https://www.microsoft.com/net/core#windowscmd (I installed the latest 2.0 preview2)
Hands-on Lab
Generate docker image docker build-t mvcapp.
Run docker image run-p 8000: 80-e "ASPNETCORE_URLS = http: // +: 80" mvcapp
If you are not familiar with the above commands, please check your help. For example, dotnet new mvc-h or docker build-h
After that, you can open the local browser and enter http: // localhost: 8000 for access.