(This article also published in my public number "dotnet daily Essence article", Welcome to the right QR code to pay attention to. )
Preface: I believe that the preferred deployment mode for future applications will certainly be Docker, so. NET community should not overlook this trend. Today's recommended article is that Microsoft Daniel Hanselman explains how to use visual Studio 2015来 to publish an ASP. NET 5 application to a Docker running on Linux.
Scott Hanselman First briefly describes the differences between virtual machines and Docker (container technology), and also mentions that Windows is about to provide Docker.
It then explains the specific steps to achieve the topic:
- Installing Docker for Visual Studio Extension in Visual Studio 2015
- Create a new or open Web application to perform a publication
- Choose an extra option when publishing: Docker Containers
- Select an existing Azure VM (virtual machine), or create a new
- If you create a new virtual machine, you will see additional Docker configuration options
- Now in the publish configuration, the information in the Connections tab is completely specific to Docker, which is filled with information such as image name and Dockerfile.
- Fill in the above information, you can publish smoothly.
One of the Docker image used in: Https://registry.hub.docker.com/u/microsoft/aspnet/,Dockerfile source code in: https://github.com/ Aspnet/aspnet-docker
Alternatively, you can install (recommend using Choco to install) Docker Windows client to remotely manipulate your Docker instance.
If you are interested in this topic, you can also go to Channel 9 to watch a video called "Docker for. NET developers".
More detailed information and can be "read the original".
Original address: Http://www.hanselman.com/blog/PublishingAnASPNET5AppToDockerOnLinuxWithVisualStudio.aspx
Use vs to publish ASP. NET 5 applications to Linux Docker