Record the first simple deployment of the Asp.netcore program onto Docker

Source: Internet
Author: User
Tags dotnet docker run

Linux version: CentOS7

1. Install Docker:yum -y install docker-io

2. Install Dontnetcore Image: Docker pull Microsoft/dotnet

If there is an error NET/HTTP:TLS handshake timeout Installation Timeout, the description is not accessible Docker.hub

Workaround add a domestic mirror address:

Vim/etc/sysconfig/docker Open the Docker configuration file,

Append--registry-mirror=http://abcd1234.m.daocloud.io to Options

so: options= "XXX--registry-mirror=http://abcd1234.m.daocloud.io"

then Restart the Docker service in effect: systemctl Restart Docker.service && systemctl restart Docker

Re-execute the installation command

3. Perform Docker run-it microsoft/dotnet into the mirror, dotnet--version View the core version, enter Exit to exit.

4.vs publish the file and use the remote tool to upload the publish file to the server.

5. Write Dockerfile (a configuration file that automatically builds a mirror),

From Microsoft/dotnetworkdir/appcopy./test. entrypoint ["Dotnet", "Dockertest.dll"]

Current directory Conditions

 

Test for the published file directory

6. In the Dockerfile directory, perform the Docker build-t dockertest. (note contains.) ), build a dockertest container that contains all the content of the Web program.

7. Run the container docker run-p 80:80-e "aspnetcore_urls=http://+:80" dockertest.

You can now access the Web application in the browser.

Record the first simple deployment of the Asp.netcore program onto Docker

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.