.NET Containers: An Introduction.
Gone are the days of staring at IIS (Internet Information Services) to figure out why your web app won’t work. Instead, in a matter of seconds, you can pull an image with your published application and start up a container.
Why Use Windows Containers for .NET Applications?
Developers can find several situations in which they can benefit from deploying current .NET applications as Windows containers. These benefits can include enhancing the agility, portability, and control that users can exert over the applications. However, the biggest reason behind using Windows containers is much simpler. Since containers also include all the application’s dependencies, and the main dependency in a .NET application is Windows, the container for a .NET application must include Windows.
According to Microsoft’s .NET Framework documentation, “A .NET Framework application must run on Windows, period. If you want to containerize existing .NET Framework applications and you can’t or don’t want to invest in a migration to .NET Core (If it works properly, don’t migrate it), the only choice you have for containers is to use Windows Containers.”
Types of Windows Containers
Windows containers come in two different types: Windows Server Containers and Hyper-V Isolation containers. These containers are also known as “runtimes” because the decision to run a Windows container with or without Hyper-V Isolation can be made at runtime.
The Windows Server Containers use process and namespace isolation to isolate the application, while they also share a kernel with both the container host and all containers running on that same host. Since these containers share their kernel space with the host, they also need the same kernel version and configuration throughout the host space. The shared kernel also means that the containers should not be used to keep untrusted code isolated.
The Hyper-V Isolation Containers run each container in their own virtual machine and do not share the same kernel with the host. The ability to use different kernels means that each container can run under different versions or configurations, while also closing off the security vulnerability that comes from running on the same kernel as the host.
How to Modernize Existing .NET Applications
The best way to modernize an existing .NET application often depends on the strategic needs the enterprise must fill with that application. The modernization paths that Microsoft documents mention include:
- Cloud-Infrastructure-Ready. The simplest migration path, also known as “lift and shift”, involves moving the applications to an infrastructure as a service (IaaS) platform.
- Cloud-Optimized. This path gives the application the benefits of containerization (improved agility, portability, etc.) while removing the need for significant alteration of the underlying code.
- Cloud-Native. The objective of this approach is to modernize mission-critical applications, and often involves significant re-coding and re-architecture of these applications.
How to Containerize Monolithic Applications
If you want to containerize a monolithic web application, you can use either the open-source platform Docker or Microsoft’s Azure App service to deploy the container to the server. One way to address scalability issues is to create clones of the container on multiple servers or virtual machines to handle the additional loads.
Window Container May Be New, But They Will Evolve
Just as the use of shipping containers brought costs down and opened up new markets in the shipping industry, the use of Windows containers has expanded the ways in which software can be implemented and deployed. As the technology evolves, so will the situations in which containers can make software development and deployment faster, easier, and more affordable.
Connect with us to learn more about introducing containers to your organization.