Getting blank culture info in Linux container

beginer
beginer
198 Points
59 Posts

I have .net core api application when running on IIS or Kestrel Server getting correct locale and culture.

But when running on Linux container it's coming blank causing DateTime.Now.ToString("t") showing incorrect format.

Using docker command as:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
Views: 61
Total Answered: 1
Total Marked As Answer: 1
Posted On: 08-Feb-2021 06:09

Share:   fb twitter linkedin
Answers
Smith
Smith
Participant
574 Points
137 Posts
         

We can set locale in dockerfile as:

# 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: 12-Feb-2021 01:29
Thanks
 - beginer  17-Feb-2021 00:42
 Log In to Chat