.NET 10 SDK AOT container images #6312
richlander
announced in
Announcements
Replies: 3 comments 5 replies
-
Are there any plans for windows server nano containers for native aot |
Beta Was this translation helpful? Give feedback.
1 reply
-
@richlander do I understand correctly that
|
Beta Was this translation helpful? Give feedback.
3 replies
-
It's still not super clear to me. Could you publish a larger table of what tags are going away or changing, or not expected to be ever tagged?
Am I correct? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We plan to publish officially-supported container images for Native AOT in .NET 10. We first offered AOT images with .NET 8 in the
nightly
branch/repo but never transitioned them tomain
, making them available and regularly updated but unsupported. We will be publishing SDK AOT images inmain
and making other cleanup changes innightly
at the same time. These new images will be supported starting with the .NET 10 RC1 release.The following images will be added to
dotnet/sdk
:10.0-preview-aot
,10.0-noble-preview-aot
10.0-preview-alpine-aot
10.0-preview-azurelinux3.0-aot
10.0-preview-trixie-aot
These tags will follow our standard practices and policies.
.NET 8 and 9
nightly
-aot
images will no longer be produced. AOT-specificruntime-deps
tags will re-tagged to non-AOT specific tags. No existing images or tags will be deleted.The intent is to provide supported AOT images to better support Native AOT users while reducing the total cost of publishing AOT images by no longer producing these unsupported .NET 8 and 9 AOT images.
We expect to make these changes with .NET 10 Preview 3. Descriptive workflows with instructions will be provided at that time.
Related
aot-deps
#4804Details
Native AOT is a publishing model that provides significant performance and other benefits. It results in a single-file executable binary that is typically very small and starts fast. It is the publishing model that is the most similar to language platforms like Go and Rust. Native AOT relies on a native toolchain for various aspects of producing an executable binary. Native toolchains are larger and often more difficult to use than the .NET SDK. The
-aot
SDK images are intended to make it easier to acquire and use a native toolchain, as an implementation detail ofdotnet publish
.Scenarios
The images are intended for two primary scenarios:
The .NET SDK offers many ease-of-use capabilties, two of which are relevant here:
dotnet publish
supports cross-compiling, enabling generating an Arm64 app on an x64 machine, for example.The first capability is supported for Native AOT in the same way as other publishing methods. While It is possible to use the .NET 10 SDK to produce a .NET 8 app, for example. .NET 10 is not currently supported, per our policies.
Cross-compiling is straightforward for most .NET apps, using some combination of the
-a
,--os
, or-r
arguments. For example, we've made it possible to build x64 container images on an Arm64 machine. That's harder with Native AOT due to the dependence on a native toolchain. We don't provide an out-of-the-box solution for that. Seereleasesapi
(sample) and Building native AOT apps in containers for more insight on cross-compilation.Size
The size of container images is an important consideration. A subset of compressed container image sizes are provided, as reported via Docker Hub tags view. The size were accurate as of March 7th, 2025. Images are all x64. Arm64 sizes will differ.
dotnet/nightly/sdk
repo:10.0-preview-alpine
10.0-preview-alpine-aot
10.0-preview-noble
10.0-preview-noble-aot
dotnet/nightly/runtime-deps
repo:8.0-alpine3.21
8.0-alpine3.21-aot
8.0-alpine3.21-extra
8.0-noble
8.0-noble-chiseled
8.0-noble-chiseled-aot
8.0-noble-chiseled-extra
The size numbers informed the decision that the
-aot
images were not sufficiently valuable to publish for theruntime-deps
repo. Users that want the ~1MB win can produce their own images. We also found that many users require the extra globalization packages in the-extra
layer, further limiting the value of the smallest images.The package differences can be seen with
diff
:The difference between the AOT and regular images (needed by CoreCLR apps) is a single package. CoreCLR depends on
libstdc++
and Native AOT does not.The difference between
aot
andextra
is two packages. ICU depends onlibstdc++
, making it a required dependency for Native AOT apps with globalization needs. As a result, the effective difference is zero packages (if globalization functionality is required).Runtime-deps repo
We will continue to update the
-aot
tags in thedotnet/nightly/runtime-deps
repo. Those tags will be mapped to the same content digest as the slightly larger non-AOT variants.For the example, the following two tags will be equivalent, the latter provided for compatibility.
8.0-alpine3.21
8.0-alpine3.21-aot
Beta Was this translation helpful? Give feedback.
All reactions