Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider supporting aspnet and runtime chiseled-aot and chiseled-extra for Ubuntu #5014

Closed
Cjewett opened this issue Nov 19, 2023 · 15 comments

Comments

@Cjewett
Copy link

Cjewett commented Nov 19, 2023

We ran into an issue recently where we swapped to jammy-chiseled images for our applications and got an error where Microsoft.SqlClient routinely failed. It doesn't support Globalization Invariant Mode and you can set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT to true or false and it won't work in either scenario with jammy-chiseled. aspnet and runtime jammy-chiseled-extra would have solved the problem while keeping dependencies to a minimum though.

dotnet/SqlClient#2206
dotnet/SqlClient#220

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@JiriZidek
Copy link

CodePages (ICU) and TZ tzdata are needed. Might be there a guide how to add them to a resulting image ?

@DanielLaberge
Copy link

DanielLaberge commented Nov 22, 2023

Please consider providing these image variants. Globalization is unfortunately required in a Web Frontend in order to render localized dates and numbers, and to make use of .resx files.

Related discussion: #4955

@JiriZidek
Copy link

AOT image, as well as distroless images in general

In fact ASP.NET 8 does not support common app: AUTH, MVC or SIGNALR are not compatible - thus AOT looks like a dead-end when considering chiseled image. For me docker file example how to add globalisation support but not using AOT and trimming would be helpful.

@JiriZidek
Copy link

So this is all the magic ? What parametr makes is ? I do not understand how ICU and TZ sneak inside the image ?

FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /source

COPY . .
RUN dotnet publish --sc -p PublishTrimmed=true -o /app

# final stage/image
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./globalapp"]

@JiriZidek
Copy link

They are installed directly in the -extra variant image

Aha ! That's what I have been voting for ! So it really exists. This was from MSFT communication not clear to me. I thought it was just an idea... Thx

@orjan
Copy link

orjan commented Nov 24, 2023

If we're doing a self contained we will ship the framework itself for every single build for every application, hence the request for the -extra image with batteries included. The would mean that we'll only ship the application for every build and application. We can't just look at a single build in isolation.

@logicaloud
Copy link

logicaloud commented Nov 24, 2023

Adding my vote. We use a shared framework deployment for a number of similar containers and several need ICU/TZDATA. Ideally they would share the same base image, i.e. "aspnet-jammy-chiseled-extra". Currently we manually build our own "extra" base image along the lines of #21, but would very much prefer an official source of such an image. Then we know it is up-to-date, without also diving into build triggers, etc., to keep the hand-crafted base image up-to-date with latest security patches

@nikolai-mb
Copy link

We have several microservices all using EF Core which requires ICU through the SqlClient dependency. Having a aspnet/jammy-chiseled-extra image would allow us to slice 40+ MB of every single container by not using self contained publish.

Are projects using EF Core (or SqlClient) really in such a minority that the aspnet variant is not justified? Looked at 10 services so far and only one can use the aspnet/jammy-chiseled variant, all others are using either EF Core or Hangfire with a SqlClient dependency.

@lbussell
Copy link
Contributor

lbussell commented Nov 27, 2023

Hi folks, we're working on the Ubuntu Chiseled .NET Runtime/ASP.NET Core images now thanks to your feedback. You can track the work in #5021. You should expect these to ship and be officially supported with the January .NET 8 servicing release.

@lbussell lbussell self-assigned this Nov 30, 2023
@lbussell lbussell moved this from Backlog to Rollout in .NET Docker Nov 30, 2023
@lbussell
Copy link
Contributor

[Triage] These images are available in the nightly aspnet and nightly runtime repos now. They will be officially supported with the next .NET servicing release (Jan).

@preardon
Copy link

preardon commented Dec 4, 2023

I need TZData as well, ICU could also be helpful

@joegoldman2
Copy link
Contributor

Hi folks, we're working on the Ubuntu Chiseled .NET Runtime/ASP.NET Core images now thanks to your feedback. You can track the work in #5021. You should expect these to ship and be officially supported with the January .NET 8 servicing release.

Great news!

I see that the .NET Runtime/ASP.NET Core distroless images with globalization support (-extra variant) are only available with Ubuntu Chiseled. Do you also plan cbl-mariner or alpine? And more generally, is there a guideline available regarding the choice of the distribution to use?

@lbussell
Copy link
Contributor

Do you also plan cbl-mariner or alpine? And more generally, is there a guideline available regarding the choice of the distribution to use?

[Triage] @joegoldman2, there are no plans currently to add -extra images for Alpine or Azure Linux (CBL Mariner) runtime and aspnet images. For Alpine, it's easy to add new packages using APK if needed. Between Azure Linux and Chiseled, our goal was to take a targeted approach and only offer images that are actively in demand by the community.

There is currently no guidance for choosing between the distros we offer. The closest we have is the Supported Platforms documentation, but that's more about what we offer. @mthalman or I will file an issue to create some guidance there.

@lbussell
Copy link
Contributor

lbussell commented Jan 9, 2024

These images are now available in the main aspnet and runtime repos. Please see the announcement: Ubuntu Chiseled runtime and aspnet images are now available in the extra variant (#5092).

@lbussell lbussell closed this as completed Jan 9, 2024
@github-project-automation github-project-automation bot moved this from Rollout to Done in .NET Docker Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

9 participants