From 648b5b3a4acb0ef16801f7bc818c8b3ccc6147e4 Mon Sep 17 00:00:00 2001 From: Olivier Benz Date: Sat, 17 Aug 2024 16:41:59 +0200 Subject: [PATCH] Dev Containers: Update handling of timezone setting --- .devcontainer/GHC.Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.devcontainer/GHC.Dockerfile b/.devcontainer/GHC.Dockerfile index 53aca7819b..bbec25c03b 100644 --- a/.devcontainer/GHC.Dockerfile +++ b/.devcontainer/GHC.Dockerfile @@ -68,14 +68,13 @@ RUN if [ -n "$USE_ZSH_FOR_ROOT" ]; then \ fix-chsh.sh; \ chsh -s /bin/zsh; \ fi \ - ## Update timezone if needed + ## Update timezone if requested && if [ "$TZ" != "" ]; then \ apk add --no-cache tzdata; \ - echo "Setting TZ to $TZ"; \ - ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \ - && echo "$TZ" > /etc/timezone; \ fi \ - ## Add/Update locale if needed + ## Info about timezone + && echo "TZ is set to $TZ" \ + ## Add/Update locale if requested && if [ "$LANG" != "C.UTF-8" ]; then \ if [ -n "$LANG" ]; then \ apk add --no-cache musl-locales musl-locales-lang; \ @@ -84,7 +83,9 @@ RUN if [ -n "$USE_ZSH_FOR_ROOT" ]; then \ sed -i "s/LANG:-C.UTF-8/LANG:-$LANG/" /etc/profile.d/*locale.sh; \ sed -i "s/LC_COLLATE=C/LC_COLLATE=$LANG/" /etc/profile.d/*locale.sh; \ sed -i "s/LC_COLLATE:-C/LC_COLLATE:-$LANG/" /etc/profile.d/*locale.sh; \ - fi + fi \ + ## Info about locale + && echo "LANG is set to $LANG" ## Copy binaries as late as possible to avoid cache busting ## Install HLS