Building a container image
This section will take you through the process of building a container image and executing it on your local system. To do this, we will first have to create an application and then add Docker support to it before we create an image and finally test it. So, let’s begin!
Creating an application
To be able to test and check what is running on the container, an application is required. For this, a new application can be created, or you can use an existing application.
When creating a new application, the easiest option is to use the default ASP.NET Core website template within Visual Studio 2019. Container support can be added in a few clicks. This is simply done by checking the Enable Docker box when creating the project:
Figure 16.2 – An ASP.Net Core new application with Docker support
Keep the new application open or open your existing application. In the next section, we will investigate how Docker support can...