From 50e053fff80dff6f72f7399a4b8471062e3e8e82 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Wed, 10 Jun 2026 17:15:42 -0500 Subject: [PATCH] RE1-T117 Fixing timezone issue in docker --- Web/Resgrid.Web.Eventing/Dockerfile | 8 +++++++- Web/Resgrid.Web.Mcp/Dockerfile | 8 +++++++- Web/Resgrid.Web.Services/Dockerfile | 8 +++++++- Web/Resgrid.Web.Tts/Dockerfile | 11 ++++++++++- Web/Resgrid.Web/Dockerfile | 8 +++++++- Workers/Resgrid.Workers.Console/Dockerfile | 11 ++++++++++- 6 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Web/Resgrid.Web.Eventing/Dockerfile b/Web/Resgrid.Web.Eventing/Dockerfile index 2a72f7aa..f7a09a97 100644 --- a/Web/Resgrid.Web.Eventing/Dockerfile +++ b/Web/Resgrid.Web.Eventing/Dockerfile @@ -26,8 +26,14 @@ WORKDIR "/src/Web/Resgrid.Web.Eventing" FROM build AS publish ARG BUILD_VERSION +## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the +## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces +## re-extraction; the test asserts the zone files are really present so the build +## fails loudly instead of silently shipping an empty /usr/share/zoneinfo. RUN DEBIAN_FRONTEND=noninteractive apt-get update \ - && apt-get install -y --no-install-recommends tzdata \ + && apt-get install -y --reinstall --no-install-recommends tzdata \ + && test -f /usr/share/zoneinfo/America/New_York \ + && test -f /usr/share/zoneinfo/Asia/Kolkata \ && rm -rf /var/lib/apt/lists/* RUN dotnet publish "Resgrid.Web.Eventing.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION} ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait diff --git a/Web/Resgrid.Web.Mcp/Dockerfile b/Web/Resgrid.Web.Mcp/Dockerfile index f05c6144..3ec20a5f 100644 --- a/Web/Resgrid.Web.Mcp/Dockerfile +++ b/Web/Resgrid.Web.Mcp/Dockerfile @@ -37,8 +37,14 @@ WORKDIR "/src/Web/Resgrid.Web.Mcp" FROM build AS publish ARG BUILD_VERSION +## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the +## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces +## re-extraction; the test asserts the zone files are really present so the build +## fails loudly instead of silently shipping an empty /usr/share/zoneinfo. RUN DEBIAN_FRONTEND=noninteractive apt-get update \ - && apt-get install -y --no-install-recommends tzdata \ + && apt-get install -y --reinstall --no-install-recommends tzdata \ + && test -f /usr/share/zoneinfo/America/New_York \ + && test -f /usr/share/zoneinfo/Asia/Kolkata \ && rm -rf /var/lib/apt/lists/* RUN dotnet publish "Resgrid.Web.Mcp.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION} ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait diff --git a/Web/Resgrid.Web.Services/Dockerfile b/Web/Resgrid.Web.Services/Dockerfile index d5f0540a..e41e6f00 100644 --- a/Web/Resgrid.Web.Services/Dockerfile +++ b/Web/Resgrid.Web.Services/Dockerfile @@ -37,8 +37,14 @@ WORKDIR "/src/Web/Resgrid.Web.Services" FROM build AS publish ARG BUILD_VERSION +## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the +## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces +## re-extraction; the test asserts the zone files are really present so the build +## fails loudly instead of silently shipping an empty /usr/share/zoneinfo. RUN DEBIAN_FRONTEND=noninteractive apt-get update \ - && apt-get install -y --no-install-recommends tzdata \ + && apt-get install -y --reinstall --no-install-recommends tzdata \ + && test -f /usr/share/zoneinfo/America/New_York \ + && test -f /usr/share/zoneinfo/Asia/Kolkata \ && rm -rf /var/lib/apt/lists/* RUN dotnet publish "Resgrid.Web.Services.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION} ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait diff --git a/Web/Resgrid.Web.Tts/Dockerfile b/Web/Resgrid.Web.Tts/Dockerfile index df1cc780..682ca451 100644 --- a/Web/Resgrid.Web.Tts/Dockerfile +++ b/Web/Resgrid.Web.Tts/Dockerfile @@ -32,7 +32,6 @@ RUN apt-get update \ xz-utils \ gzip \ passwd \ - tzdata \ && rm -rf /var/lib/apt/lists/* \ && curl -fsSL --retry 3 --retry-delay 5 "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -o /tmp/ffmpeg.tar.xz \ && curl -fsSL "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz.md5" -o /tmp/ffmpeg.tar.xz.md5 \ @@ -85,6 +84,16 @@ RUN apt-get update \ && find /usr/local/lib -name '*.so*' -type f >> /tmp/ttsdeps/libs.txt \ && sort -u /tmp/ttsdeps/libs.txt | while read lib; do [ -f "$lib" ] && cp "$lib" /tmp/ttsdeps/; done +## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the +## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces +## re-extraction; the test asserts the zone files are really present so the build +## fails loudly instead of silently shipping an empty /usr/share/zoneinfo. +RUN apt-get update \ + && apt-get install -y --reinstall --no-install-recommends tzdata \ + && test -f /usr/share/zoneinfo/America/New_York \ + && test -f /usr/share/zoneinfo/Asia/Kolkata \ + && rm -rf /var/lib/apt/lists/* + FROM base AS final WORKDIR /app diff --git a/Web/Resgrid.Web/Dockerfile b/Web/Resgrid.Web/Dockerfile index 6c0a853c..0d516642 100644 --- a/Web/Resgrid.Web/Dockerfile +++ b/Web/Resgrid.Web/Dockerfile @@ -20,7 +20,13 @@ FROM dhi.io/dotnet:9.0.314-sdk-debian13@sha256:a3acd51de0af79878e26292b3053aab51 #COPY --from=node_base /usr/local/bin /usr/local/bin RUN apt-get update RUN apt-get install -y ca-certificates curl gnupg -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata +## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the +## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces +## re-extraction; the test asserts the zone files are really present so the build +## fails loudly instead of silently shipping an empty /usr/share/zoneinfo. +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall --no-install-recommends tzdata \ + && test -f /usr/share/zoneinfo/America/New_York \ + && test -f /usr/share/zoneinfo/Asia/Kolkata RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - RUN apt-get -y install nodejs ARG BUILD_VERSION diff --git a/Workers/Resgrid.Workers.Console/Dockerfile b/Workers/Resgrid.Workers.Console/Dockerfile index cea9b7bb..aa79b303 100644 --- a/Workers/Resgrid.Workers.Console/Dockerfile +++ b/Workers/Resgrid.Workers.Console/Dockerfile @@ -57,7 +57,6 @@ RUN apt-get update \ libxext6 \ libxrender1 \ zlib1g \ - tzdata \ && wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \ && dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb || apt-get install -fy \ && rm -f wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \ @@ -65,6 +64,16 @@ RUN apt-get update \ && ldd /usr/local/bin/wkhtmltopdf | awk '/=>/ {print $3}' | while read lib; do cp "$lib" /tmp/wkdeps/; done \ && apt-get clean && rm -rf /var/lib/apt/lists/* +## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the +## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces +## re-extraction; the test asserts the zone files are really present so the build +## fails loudly instead of silently shipping an empty /usr/share/zoneinfo. +RUN apt-get update \ + && apt-get install -y --reinstall --no-install-recommends tzdata \ + && test -f /usr/share/zoneinfo/America/New_York \ + && test -f /usr/share/zoneinfo/Asia/Kolkata \ + && rm -rf /var/lib/apt/lists/* + FROM base AS final WORKDIR /app