.NET Core

In this lesson, you will be provided with the basic application image for .Net Core.

We'll cover the following

Files#

You can find these files in the code/common-development-profiles/demos/aspnet-core folder.

A static HTML file to be served:

wwwroot/index.htm



A REST API coded with ASP.NET Core MVC:

ApiController.cs



Configuration of the HTTP server (middleware and dependency injection):

Startup.cs



Spin up the HTTP server:

Program.cs



The .csproj file containing build instructions:

aspnet-core.csproj



Definition of the image to build:

Dockerfile

Result#

Run the following program to display the output of the .NET application using a docker file. When the server is set, click on the Output tab to display the result.

/
Dockerfile
Your app can be found at: https://811lgmnxmw1xy.educative.run

The resulting image is published as learnbook/aspnetcore-server. You can run a local container from it with the following command:

Then point your browser to http://localhost:8088


Let’s look at another image in the next lesson.

Python
Restart Mode
Mark as Completed
Report an Issue