Last Updated: 27 September 2022

Containerization of .Net 6 API & Web Apps with Docker

Most people are familiar with the shipping container. It revolutionized world trade because it was completely standardised, giving handlers high confidence that any container will work with any ship, train, truck or crane.

Containers in the software sense follow this analogy quite well. They are a standardised, self contained, applications. Your dev teams can use any language or runtime they feel comfortable with (Java, .Net, Python, Javascript) and this standardization and repeatability allows for a high level of Dev Ops automation. 'Repeatability' in this sense means that it is almost trivial to get an application running in an environment, without complex installation procedures or configuration. In our presentation, we show how easy it is to fire up a fully-functional web site and backend API in Microsoft Azure and other cloud platforms.

One of the keys to the container ecosystem is that it allows applications to share an operating system kernel, which means more apps on the same amount of hardware - when compared to traditional virtual machines (VM) for example. The downside is less isolation. Containerization is the abstraction of the application layer, rather than the hardware layer.

.Net Core API architecture layers

Docker is one of the most popular enablers for containerization, which is free and open source. It runs on Linux and Windows, with most users preferring the former. It is, however, straightforward to develop .Net Core containers targeting Linux even when using a Windows-based dev environment. It is also possible to create containers that target ARM-based devices, as we demonstrate with our free Raspberry Pi Azure DevOps Build Status TV app that we build and containerize using an Azure DevOps ARM build agent.

We have delivered a talk about the containerization of .Net Core web apps and APIs on a number of occasions to various clients and teams of all sizes. If you'd like to know more about how developers can go from writing code to running their applications as a container, get in touch to see how we can help.

There's more information and hands-on demonstrations in our presentation. Watch the full video on .Net Core MVC and API containerization.