❔ change timezone of aspnet docker container

how to change aspnet docker container's timezone? i am using this image mcr.microsoft.com/dotnet/aspnet:7.0.5-jammy. i already tried changing the TZ variable in my docker compose but it is still showing UTC. thanks
2 Replies
realivanjxツ
realivanjxツOP2y ago
i need to use local time as output file name solved this by installing tzdata and using this script as the entrypoint:
rm /etc/localtime && \
echo $TZ > /etc/timezone && \
dpkg-reconfigure tzdata && \
exec /app/name
rm /etc/localtime && \
echo $TZ > /etc/timezone && \
dpkg-reconfigure tzdata && \
exec /app/name
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?