Home > Article > Backend Development > Teach you how to publish dotnet core to docker in Visual studio 2017
This article mainly introduces the relevant information on how Visual studio 2017 publishes dotnet core to docker. It has certain reference value. Interested friends can refer to it.
Needless to say, the benefits of docker are: If you don't understand, you can refer to "Introduction to Docker". As a .net veteran, I also want to catch the last train of docker as soon as possible to reduce various pitfalls in deployment. Below are the steps I took to fully run it after the official version of Visual Studio 2017 was released (in fact, VS2015 is also available).
The first step: Install docker
Download address: www.docker.com/docker-windows, while downloading, first go to "Control Panel" and "Programs" Enable "Hyper-V". After the activation is completed, the download is basically completed. When ensuring that the download is completed, restart the computer, and then start installing docker. Basically, "next" is completed.
Second step: Configuring docker
Compatriots in the local area network need a ladder. The ss I use is filled in in the "settings"->"proxies" of docker Enter your proxy, mine is "127.0.0.1:1080". If you don’t have a ladder, use a domestic mirror. In “settings”->”daemon”, fill in the mirror address: http://f2d6cb40.m.daocloud.io (I haven’t tested this mirror. I use a ladder, which is also available online. It says that the proxy configured in this way cannot be used. I don't know if it is because his ss does not enable "Introduce links from the LAN". My configuration can be used). Then enable disk sharing. "Settings"->"shared drives" must enable the C drive (to be precise, it should be the system drive), and then connect to the drive where the enabled project is located. All operations are as shown:
Step 3: Open vs2017 Create a new dotnetcore web project and make sure to enable docker support. Of course, if you have no choice, you can also right-click "Add" - "Docker Support" in the "Solution Explorer" project. (The red box is the necessary files for docker). At this time, you can run F5 in docker mode.
Running effect: You can see it in docker-》"kitematic". Of course, the host browser will also see it. OK call it a day, there will be a lot of pits without a ladder, and the prompts are weird!The above is the detailed content of Teach you how to publish dotnet core to docker in Visual studio 2017. For more information, please follow other related articles on the PHP Chinese website!