Docker generates a Docker image for an ASP. NET Core application and runs multiple containers

Source: Internet
Author: User
Tags dotnet docker run oracle vm virtualbox vm virtualbox

1. Generating a Docker image for an ASP. NET Core Application

Download this case project: Https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp

When the download is complete, generate a mirror named Aspnetapp image for this project.

Docker build-t Aspnetapp.

In order to make a difference I created a a.html file in wwwroot after the Aspnetapp image was generated, and another image named Webappa was generated.

Docker build-t Webappa.

2. Create a new container for the image you just created and run
Docker run-d-P 5000:80--name WebApp Spnetapp
Docker run-d-P 5001:80--name webapp2 Aspnetapp
Docker run-d-P 5002:80--name Webappa Webappa

3. Separate visits

Note: My docker is installed on the Windows 7 Service Pack System, My Computer intranet IP is 10.0.0.203, after the installation is completed, two virtual networks are created locally, respectively, the 192.168.56 network segment and the 192.168.99 network segment

View Docker's system IP address needs to open Oracle VM VirtualBox View

Click Show Enter, enter IP addr show eth0 and IP addr show eth1 view IP address for 10.0.2.15 and 192.168.99.100

Input 192.168.99.100:5000,192.168.99.100:5001,192.168.99.100:5002 access to individual container applications

Tip: We can also enter kitematic (Alpha) to view the running container, and the access address of the container app

4. Configure Nginx to allow 10.0.0 network access

Configure the reverse proxy in Nginx to provide external network access

External network access: 10.0.0.203:81,10.0.0.203:82,10.0.0.203:83 access to individual container applications

Before creating a second Webappa mirror, I created a a.html in the Wwwroot folder to access the normal display, indicating that the direction agent is normal

Docker generates a Docker image for an ASP. NET Core application and runs multiple containers

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.