Only the invariant culture is supported in globalization-invariant mode

Raj
Raj
648 Points
26 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: 2298
Total Answered: 1
Total Marked As Answer: 1
Posted On: 06-Dec-2022 02:10

Share:   fb twitter linkedin
Answers
Smith
Smith
2890 Points
78 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