Overview: Build a bootable .NET 10 application using image mode for RHEL with Podman Desktop
If you’re looking to rapidly develop and deploy web-based applications and have experience working in C#, .NET can be an excellent choice, particularly for building high-performance, cross-platform applications. The quickest way to deploy this powerful stack is as a bootable container either on-premise or in the public cloud. This learning path is designed to get you up and running quickly.
Red Hat Enterprise Linux (RHEL) supports image mode, a deployment method that allows you to take a container-native approach to deploying a fully bootable operating system environment on bare metal or virtual machines (VMs) targeting on-premise or cloud deployment. A key advantage of the image mode for RHEL approach for application deployment is that bootable containers carry with them a full environment that can be used for testing and production.
Image mode allows you to define an entire system from the RHEL base to your .NET application and its dependencies using a Containerfile. Instead of configuring a base operating system (OS) and then deploying your app container onto it (and hoping the OS stays consistent), your .NET app and the underlying RHEL operating system are intrinsically linked and built from a single definition. You can leverage your existing knowledge of Containerfile syntax and container build processes to create a full disk image (i.e., qcow2, AMI, ISO, etc.).
If you are developing .NET applications on Windows, moving applications to image mode for RHEL can help reduce exposure to "it works on my machine" issues. Within a traditional Windows environment, it’s not uncommon to have a developer RDP into a Staging server to test a fix, only to have a Windows admin manually change a setting on one production box but not the others, and suddenly our environments are out of sync. This behavior has burned us all more than once. Image mode for RHEL discourages this by packaging and deploying the entire OS together. The entire image, the application, services, and OS environment are integrated, tested, deployed and managed together.
What’s more, image mode for RHEL uses a model that treats the OS just like our application. We can define the entire ASP.NET workload from top to bottom, including the RHEL base, the .NET runtime, our ASP.NET components, and our application, in a single Containerfile that we keep under source control. The Containerfile approach to the workload development means we are able to easily automate validation of the full environment every time we make any changes. It’s a single unit I can generate and test through our CI/CD pipeline.
The bootable image we develop and test locally with Podman Desktop is the same image deployed as a VM or bare metal machine in staging or production, on-prem, or in the cloud. Because the OS and the application are one unit, it boots and runs the same way everywhere, mitigating many common issues of inconsistent performance. Deploying the application with a bootable container greatly simplifies reproducing the application and its environment, as well as troubleshooting and debugging.
Prerequisites:
- A no-cost Red Hat Developer subscription
- Download Podman Desktop for Windows, macOS, or Linux (Fedora or RHEL)
In this learning path, you will:
- Access the Red Hat Container Registry.
- Learn how to install the Red Hat Single Sign-On (SSO) extension.
- Build a sample ASP.NET Core application in a container used for development.
- Build and run a bootable ASP.NET Core application disk image in Podman Desktop using image mode.