WINDOWS10 application Docker Deployment Donet Core

Source: Internet
Author: User
Tags dotnet docker run

Win10 and Mac stable version of Docker released, before looking at the next Xu Lei teacher's several docker4dotnet articles http://devopshub.cn/2016/07/08/ Docker4dotnet-1-overview-and-helloworld/, but never did. Lazy cancer is late.

Prepare a dotnet Core Web application, test it, and make minor changes.

To verify the environment of the current host in order to run, no other meaning

By the way, you can specify the next program entry, at startup, through the command line to specify a listening port:

               iconfiguration config  = new Configurationbuilder ()              . Addcommandline (args)                      . Build ();            var host = new Webhostbuilder ()   . Useconfiguration (config)                . Usekestrel ()                . Usecontentroot (Directory.GetCurrentDirectory ())                 . Usestartup<startup> ()                . Build ();

Then simply restore the next reference, then publish a test

Run it and prove that the code can run normally. And it's running under my machine:desktop-078ua43.

Test the Docker

pull off the dotnet core image after installing Docker Docker Pull Microsoft/dotnet:latest

You can then wear a dockerfile under the project root to fill in the information you want to package:

From microsoft/dotnet:latest# Set, the working directoryworkdir./app # Configure The listening port to the EXPOSE 5006 # Co PY the appcopy/bin/debug/netcoreapp1.0/publish//app/  # Start The Appentrypoint dotnet DotNetCoreSample.dll-- Server.urls  

Then it can be packaged and run (Docker run-d-P 5008:5004 coresample can be registered as a background process)

Visit the next http://localhost:5008/Home/About to see that the operating environment is already in the container.

WINDOWS10 application Docker Deployment Donet Core

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.