Announcement: New approach for differentiating .NET 8+ images #4821
Replies: 6 comments 9 replies
-
Hi @richlander,
We are hoping to switch over to chiseled images for our ASP.NET Core APIs to get smaller images that we are hosting in Azure Container Apps. Our APIs use Microsoft.Data.SqlClient, which has a dependency on ICU. See here. It would be awesome if chiseled aspnet images are also published with a "batteries included" variant. |
Beta Was this translation helpful? Give feedback.
-
I'd like to join in hoping for a "batteries included" option. In microservices scenarios or for pod compositions where multiple dotnet based containers work together, a single shared framework container may have a larger size than an AOT container, but because the base image layer (i.e., "aspnet-jammy-chiseled-extra") can be shared between the various containers, this will probably still have a smaller overhead than several AOT based containers. As such, if the objective is to enable small deployment sizes, then having a "batteries included" image would be a great option. Edit: I'd like to add that AOT is not always an option, a shared framework deployment may be a requirement for many apps. |
Beta Was this translation helpful? Give feedback.
-
There is now another open issue where comments are encouraged to express support for a chiseled ASPNET images with ICU/TZDATA included (see note in https://devblogs.microsoft.com/dotnet/announcing-dotnet-chiseled-containers/). If anyone would like to add their voice, then please head over to #5014. |
Beta Was this translation helpful? Give feedback.
-
Yes, we need that. Show some support for the the |
Beta Was this translation helpful? Give feedback.
-
How do I get the list of bundled assemblies and their versions? |
Beta Was this translation helpful? Give feedback.
-
@richlander sorry for kind of hijacking this thread, but does this mean that we won't have new versions of mcr.microsoft.com/dotnet/sdk seems to not have any of the 8.0.30x versions (stuck at 8.0.203)? |
Beta Was this translation helpful? Give feedback.
-
We are defining a (subtly different) approach to the various kinds of images we ship, for .NET 8+. In short, some images will be "batteries included", others will be as small as possible, and another set will be "choose your own adventure". This model can be thought of as "opinionated" or pragmatic differentiation.
This new plan aims to resolve the following issues:
clang
, ...) add significant complexity and build cost to app Dockerfiles, particularly for cross-compiling.Related issues:
aot-deps
#4804Batteries included
The "batteries included" plan is really "globalization included". Up until now, we installed
icu
in some images, but nevertzdata
. That doesn't make much sense, since ICU is huge, andtzdata
is relatively small, yet they both power .NET globalization/world APIs.Ubuntu and Debian images will have ICU and
tzdata
installed. The practical impact of this is that Ubuntu images will get 1.2MB larger. Debian base images already containtzdata
so our Debian images won't change.Alpine images have always been focused on size. We do not plan to change that (beyond some opt-in options discuss later).
Changes:
tzdata
toruntime-deps:8.0-jammy
(used byruntime
,aspnet
, andsdk
images with the same tag).tzdata
toruntime-deps:8.0-bookworm-slim
(used byruntime
,aspnet
, andsdk
images with the same tag).Note: Adding
tzdata
to Debian Bookworm images should have no practical effect, unless there is an update totzdata
(that is not yet included in Debian) at which point .NET images will now include a newertzdata
(and the size will increase commensurately).Some packages will still be optional, such as Kerberos, LDAP, and msquic. They are only required by niche scenarios.
As small as possible
Alpine, Mariner distroless, and Ubuntu Chiseled images are all focused on size. These images do not and will not include ICU or
tzdata
. That's the status-quo, so no change. This also means that these images only work with apps that are configured for globalization invariant mode.Notes:
aspnet
offering for CoreCLR.Changes:
Choose your own adventure
We've come to realize that the
runtime-deps
images we provide have significant value, particularly since they include a standard user and port definitions. They are convenient to use for self-contained and native AOT scenarios. However, solely providing runtime-deps images that are needed by the runtime and sdk images we ship isn't sufficient to enable all the scenarios one can imagine or generate optimal images.This need primarily only applies to native AOT and the distroless/chiseled image types.
For each variant, we will provide three image variants (all in
runtime-deps
), using chiseled images as an example:8.0-jammy-chiseled
-- "as small as possible" images for CoreCLR (notzdata
oricu
)8.0-jammy-chiseled-aot
-- "as small as possible" images for native AOT (notzdata
,icu
, orstdc++
)8.0-jammy-chiseled-extra
-- "batteries included" image for both CoreCLR and native AOT (includestzdata
,icu
, andstdc++
)In terms of scenarios:
8.0-jammy-chiseled
images will be the base forruntime
andaspnet
repo images (of the same tag).8.0-jammy-chiseled-aot
image, by default, since it is optimized for size.8.0-jammy-chiseled-extra
.Alpine and Mariner images will use the same scheme.
We don't plan to offer
runtime
andaspnet
images based on8.0-jammy-chiseled-extra
. We will re-consider that if there is sufficient demand.Debian and Ubuntu (non-chiseled)
runtime-deps
images will not have multiple variants.Changes:
aot
andextra
variants for8.0-alpine
,8.0-cbl-mariner2.0-distroless
,8.0-jammy-chiseled
.Building native AOT container images
We will publish
-aot
SDK images (in thesdk
repo) that enable building native aot apps. They will be created for distros with matchingruntime-deps:*-aot
images. These images are very large, about twice the size of regular SDK images.AOT images will be published for:
This approach will enable a developer to write Dockerfiles that are very similar to the model used for CoreCLR. It will also enable an easy path to using SDK container builds with native AOT.
Changes:
-aot
sdk variant for8.0-alpine
,8.0-cblmariner2.0
, and8.0-jammy
Beta Was this translation helpful? Give feedback.
All reactions