<p>I have the next docker file where I have defined timeZone to America/Bogota, then where The Azure pipeline build the image I can see in the log date is correct from dockerfile, but when I exec the pod in azure Kubernetes the timezone is different. Why the kubernetes pod don't take timezone America/Bogota?</p>

<pre><code>FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src

COPY NuGet.Config ./
COPY NugetPackage/travelExpensesRestClient.1.0.0.nupkg NugetPackage/
RUN dir /src/NugetPackage

COPY microservicioX/microservicioX.csproj microservicioX/
COPY travelExpenses.Viajes.Proxy/travelExpenses.Viajes.Proxy.csproj travelExpenses.Viajes.Proxy/

RUN dotnet restore -nowarn:msb3202,nu1503  microservicioX/microservicioX.csproj #--verbosity diag
COPY . .
WORKDIR /src/microservicioX
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish microservicioX.csproj -c Release -o /app


WORKDIR /
ENV TZ=America/Bogota
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &amp;&amp; echo $TZ &gt; /etc/timezone
RUN date


FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "microservicioX.dll"]

</code></pre>

<p>For more Details: in the azure pipeline I can see the correct timezone
<a href="https://i.ibb.co/wgSzHS9/Time-Zone-build-Image.png" rel="nofollow noreferrer">https://i.ibb.co/wgSzHS9/Time-Zone-build-Image.png</a></p>

<p>Time Zone in the azure kubernetes pod
<a href="https://i.ibb.co/hm25Xkc/Time-Zone-in-Pod.png" rel="nofollow noreferrer">https://i.ibb.co/hm25Xkc/Time-Zone-in-Pod.png</a></p>

Felix David Hernandez Aldana
<p>I think you might be defining the TZ in a different image</p>

<p>This is the <code>publish</code> image:</p>

<pre><code>FROM build AS publish
RUN dotnet publish microservicioX.csproj -c Release -o /app


WORKDIR /
ENV TZ=America/Bogota
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &amp;&amp; echo $TZ &gt; /etc/timezone
RUN date
</code></pre>

<p>And that's where you set the TZ. This is the <code>final</code> image where the application runs:</p>

<pre><code>FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "microservicioX.dll"]
</code></pre>

<p>You are not setting TZ here. Adding the TZ here just like you did in the <code>publish</code> image should be sufficient, I think. </p>
