Running ASP.NET Core in a container
In this section, we will create a simple ASP.NET Core application that accesses our Redis container. We will then run the application in a container. The majority of this we will do from the command line, but we will jump into Visual Studio to show some of the great tooling available:
- The first step is to create a new directory and create a basic .NET web application. In the following Figure 9.18, we can see what ASP.NET projects are available by using the
dotnet new ASP.NET -l
command: - Next, we need to create a folder for our solution with the
mkdir Chap9
command and create an empty solution with thedotnet new sln
command as shown in Figure 9.19: - Then we create another folder within the previous one called
web
with themkdir web
command. Remember to change directory, for example, usingcd web
, into the created folder. Create a newASP.NET Core Empty
project...