Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Biagio Paruolo 1619 posts 1911 karma points c-trib
    Aug 02, 2024 @ 15:22
    Biagio Paruolo
    0

    Error on Linux Ubuntu mcr.microsoft.com/dotnet/aspnet:8.0-jammy Docker : en-US is an invalid culture identifier

    Hi,

    I create a docker image on Linux for Umbraco version 13.1.1. Umbraco works on dev machine but when it start into the container it crash and I've this error:

    System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name') agripass360-1 | en-US is an invalid culture identifier. at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)

    On Linux I installed the ICU libs and part of the docker file is:

    FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS base USER root

    Install cultures (same approach as Alpine SDK image) for ALPINE

    RUN apk add --no-cache icu-libs icu-data-full ENV DOTNETSYSTEMGLOBALIZATION_INVARIANT=true ENV

    DOTNETRUNNINGIN_CONTAINER=true RUN apt-get update && apt-get install -y libicu-dev WORKDIR /app EXPOSE 8080 EXPOSE 8081

    ....

    FROM base AS final ENV DOTNETSYSTEMGLOBALIZATIONINVARIANT=true RUN apt-get install -y libicu-dev WORKDIR /app COPY --from=publish /app/publish . USER root RUN mkdir -p /app/umbraco/Data/TEMP RUN mkdir -p /app/umbraco/Data/TEMP/FileUploads RUN chown -R $APPUID:$APPUID /app USER $APPUID ENTRYPOINT ["dotnet", "dddd.dll"]

    Why?

  • Biagio Paruolo 1619 posts 1911 karma points c-trib
    Aug 02, 2024 @ 17:37
    Biagio Paruolo
    100

    I solved the issue.

    I deleted the EN-us dictionary and remove it from the languages tree. The problem is on the Umbraco side.

    I don't need the

    #ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0 
    

    into the docker file. I install the ICU libs into the container:

    RUN apt-get update && apt-get install -y libicu-dev  
    
Please Sign in or register to post replies

Write your reply to:

Draft