Microsoft Provides First Preview of .NET Containers
Integrated container support in the .NET SDK
provider on topic
In the first preview, Microsoft has upgraded the .NET SDK (Software Development Kit) with integrated container support. In the future, this will make it possible to easily create containerized app versions as container images with dotnet publish.
The current difference between the .NET build and Docker build processes was the background of the .NET SDK’s built-in container support. Originally, all the information needed to build a container image was available in the standard dotnet build, as writes Chet Husk, program manager in the .NET Tools team at the Microsoft Devblog. “We had to find the right way to present this data in a way that containers like Docker could consume at runtime.”
The .NET SDK preview is now based on a multi-stage build, Husk explains the background: “A container image consists of two main parts: a JSON configuration, which contains metadata about how the image can be run, and a list of tarball archives representing the filesystem.” In .NET 7, several APIs were added to the .NET runtime for handling .tar files and streams, opening up the ability to programmatically manipulate container images.
According to Husk, many aspects of the generated image can be customized using MSBuild properties and elements, while some default values should make it easier to initialize. More detailed information on manipulating image names, registry entries, tags, and other settings can be found in the .NET Preview documentation on GitHub.
According to Microsoft, containers can be used in a variety of contexts, for local development as well as within continuous integration pipelines. During the pending release candidate phases, Microsoft plans to add new image metadata, support for pushing images to remote registries, and support for Windows Images.