Red Hat provides .NET container images that are freely available to everyone under the UBI license. It is distinguished by their end-to-end security and trusted software supply chain practices, including active CVE monitoring and detailed SBOMs. These images offer optional enterprise support on Red Hat platforms and are available for multiple architectures, including IBM Z and Power Systems, with separate repositories for the .NET SDK, ASP.NET Core runtime, and .NET runtime. This article discusses why you might choose Red Hat's .NET images and provides an overview of available images.
Why use a .NET image from Red Hat
Red Hat .NET images are available under Red Hat's Universal Base Image (UBI) license, which means you can freely use, modify, extend, and redistribute them. You don’t need a Red Hat subscription.
Enterprise support available
When running on a Red Hat supported platform, Red Hat Enterprise Linux (RHEL) or OpenShift, these images are supported by Red Hat. On other platforms, community support is available.
Regardless of the support model, the images receive security fixes and patches.
Security and software supply chain
Building a container image is easy. Building a trusted one is very difficult.
Red Hat container images are completely built by Red Hat. This is different from, for example, an image that uses the Alpine base image (maintained by the Alpine community) which adds Microsoft built .NET packages on top.
Everything in the image is open-source. For each component, the process starts with obtaining the sources in a secure manner. Once those are in a trusted Git repository, there are different builds, tests, reviews, artifact stores until we get to the image from the Red Hat Container Registry. This software supply chain uses software bill of materials (SBOMs), hermetic builds, and attestations to have a detailed, immutable record of what is in the image and how it was built.
Red Hat actively monitors all these components for CVEs. The software supply chain enables us to know exactly what images are affected and need an update to address vulnerabilities.
Additional architectures
In addition to 64-bit AMD/Intel and 64-bit ARM architectures provided by Microsoft, Red Hat images are also available for IBM Z and IBM Power Systems, Little Endian (POWER9).
.NET images
The Red Hat Container Registry (registry.access.redhat.com) provides .NET SDK images and .NET runtime images. Previously, each .NET version had its own image repository, such as ubi8/dotnet-80 for the .NET 8 SDK image. For easier usage, the images are now also available from dotnet/<name> repositories that provide different .NET versions through tags, such as dotnet/sdk:8.0. These repositories are available.
The dotnet/sdk repository provides the SDK images. Use this repository to build .NET applications and libraries.
# Run the .NET 8.0 SDK container image.
$ podman run registry.access.redhat.com/dotnet/sdk:8.0 dotnet --version
8.0.122The dotnet/aspnet repository provides base images for ASP.NET Core applications. A straightforward way to use it is with the .NET SDK's built-in container tooling by setting the ContainerBaseImage property.
# Publish an ASP.NET Core 9.0 app as a container image using Red Hat's ASP.NET Core runtime image as the base image.
$ dotnet publish /p:ContainerBaseImage=registry.access.redhat.com/dotnet/aspnet:9.0 /t:PublishContainer -v detailedStarting with .NET 10, the dotnet/runtime repository provides smaller base images for framework-dependent non-web worker applications. These are also directly usable with .NET’s built-in container tooling.
# Publish a (non-web) .NET 10.0 app as a container image using Red Hat's .NET runtime image as the base image.
$ dotnet publish /p:ContainerBaseImage=registry.access.redhat.com/dotnet/runtime:10.0 /t:PublishContainer -v detailedLearn more
Now that you've learned about the advantages of .NET container images from Red Hat, you can find more information in the Red Hat .NET documentation. To learn more about building container images with the .NET SDK, you can go through the Containerize a .NET app tutorial and consult the reference documentation.