. NET Core Demo & Docker images

Source: Internet
Author: User
Tags dotnet docker run

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

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.