dotnet-staticfiles icon indicating copy to clipboard operation
dotnet-staticfiles copied to clipboard

Include ICU support?

Open 616b2f opened this issue 3 years ago • 4 comments

I tried your samples (they are great by the way, thank you so much for them!) and they lack ICU support, it would be great to have one example with ICU support enabled:

I used this for that

RUN apk add --no-cache icu-libs

Or maybe for distroless it could also make sense to use this instead of icu-libs:

    <ItemGroup>
        <RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.6" />
        <PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" />
    </ItemGroup>

What do you think?

616b2f avatar Nov 24 '21 10:11 616b2f

@616b2f I'm glad you like these samples. This would be low down my priority list at the moment but feel free to submit a PR if you need something urgently.

dpbevin avatar Feb 02 '22 08:02 dpbevin

Adding the ItemGroup with Microsoft.ICU.ICU4C.Runtime didn't work for me. I kept getting an error "Failed to load app-local ICU: libicuuc.so".

What did work for me though was adding RUN apk add --no-cache icu-libs to the dotnet runtime deps stage, ie:

# Use dotnet runtime deps to gather all dependencies
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-alpine3.13-amd64 as base

# Add Unicode and Globalization support via International Components for Unicode (ICU package)
RUN apk add --no-cache icu-libs

# Cleanup /lib
RUN find /lib -type d -empty -delete && \
    rm -r /lib/apk && \
    rm -r /lib/sysctl.d

And then update environment DOTNET_SYSTEM_GLOBALIZATION_INVARIANT to false.

michaeldimoudis avatar Mar 24 '22 00:03 michaeldimoudis

So as of June 15 2022 it looks like icu is removed from runtime-deps, making the above comment obsolete now. I couldn't figure out how to get icu-libs working again as yet. but apparently there is more distroless stuff coming from Microsoft in the coming months going by this twitter thread https://twitter.com/Jamie_Magee/status/1529662529386926080?s=20&t=XmscBSmhcgEzu35vxqdVIA

michaeldimoudis avatar Jun 15 '22 05:06 michaeldimoudis

Looking forward to Mariner-based images being publicly supported.

dpbevin avatar Jun 17 '22 08:06 dpbevin