Only the invariant culture is supported in globalization-invariant mode

Raj
Raj
Member
72 Points
21 Posts

I'm working on dockerised environment. I'm using Alpine image to build and run the docker image but getting following:

---> System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')

 

Views: 312
Total Answered: 1
Total Marked As Answer: 1
Posted On: 06-Dec-2022 02:10

Share:   fb twitter linkedin
Answers
Smith
Smith
Moderator
754 Points
157 Posts
         

The Alpine runtime image doesn't have cultures installed. You can install the ICU libraries in Alpine using apk add icu-libs. Your runtime Dockerfile will need to start with something like this:

# Install cultures (same approach as Alpine SDK image)
RUN apk add --no-cache icu-libs

# Disable the invariant mode (set in base image)
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
# Set the locale
    LC_ALL=en_US.UTF-8 \
    LANG=en_US.UTF-8
Posted On: 06-Dec-2022 05:14
thanks.
 - Raj  24-Jan-2023 05:57
 Log In to Chat