diff --git a/Web/Resgrid.Web.Eventing/Dockerfile b/Web/Resgrid.Web.Eventing/Dockerfile index 504c68591..2a72f7aa0 100644 --- a/Web/Resgrid.Web.Eventing/Dockerfile +++ b/Web/Resgrid.Web.Eventing/Dockerfile @@ -26,12 +26,19 @@ WORKDIR "/src/Web/Resgrid.Web.Eventing" FROM build AS publish ARG BUILD_VERSION +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && apt-get install -y --no-install-recommends tzdata \ + && 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 RUN chmod +x /app/publish/wait FROM base AS final WORKDIR /app +## Copy the IANA timezone database. DHI/distroless bases ship without tzdata, +## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException. +COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo +ENV TZ=Etc/UTC COPY --from=publish /app/publish . # docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND. # These hardened (distroless) images have no shell, so we can't chain with "sh -c". diff --git a/Web/Resgrid.Web.Mcp/Dockerfile b/Web/Resgrid.Web.Mcp/Dockerfile index 5900621ac..f05c61446 100644 --- a/Web/Resgrid.Web.Mcp/Dockerfile +++ b/Web/Resgrid.Web.Mcp/Dockerfile @@ -37,12 +37,19 @@ WORKDIR "/src/Web/Resgrid.Web.Mcp" FROM build AS publish ARG BUILD_VERSION +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && apt-get install -y --no-install-recommends tzdata \ + && 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 RUN chmod +x /app/publish/wait FROM base AS final WORKDIR /app +## Copy the IANA timezone database. DHI/distroless bases ship without tzdata, +## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException. +COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo +ENV TZ=Etc/UTC COPY --from=publish /app/publish . # docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND. # These hardened (distroless) images have no shell, so we can't chain with "sh -c". diff --git a/Web/Resgrid.Web.Services/Dockerfile b/Web/Resgrid.Web.Services/Dockerfile index ef690221d..d5f0540af 100644 --- a/Web/Resgrid.Web.Services/Dockerfile +++ b/Web/Resgrid.Web.Services/Dockerfile @@ -37,12 +37,19 @@ WORKDIR "/src/Web/Resgrid.Web.Services" FROM build AS publish ARG BUILD_VERSION +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && apt-get install -y --no-install-recommends tzdata \ + && 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 RUN chmod +x /app/publish/wait FROM base AS final WORKDIR /app +## Copy the IANA timezone database. DHI/distroless bases ship without tzdata, +## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException. +COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo +ENV TZ=Etc/UTC COPY --from=publish /app/publish . # docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND. # These hardened (distroless) images have no shell, so we can't chain with "sh -c". diff --git a/Web/Resgrid.Web.Tts/Dockerfile b/Web/Resgrid.Web.Tts/Dockerfile index f1b3379e8..df1cc7803 100644 --- a/Web/Resgrid.Web.Tts/Dockerfile +++ b/Web/Resgrid.Web.Tts/Dockerfile @@ -32,6 +32,7 @@ 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 \ @@ -95,6 +96,10 @@ COPY --from=publish /usr/local/bin/ffprobe /usr/local/bin/ffprobe COPY --from=publish /tmp/ttsdeps/ /usr/local/lib/tts/ COPY --from=publish /tmp/app-passwd /etc/passwd COPY --from=publish /tmp/app-group /etc/group +## Copy the IANA timezone database. DHI/distroless bases ship without tzdata, +## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException. +COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo +ENV TZ=Etc/UTC COPY --from=publish /app/publish . ENV LD_LIBRARY_PATH="/usr/local/lib/tts" diff --git a/Web/Resgrid.Web/Dockerfile b/Web/Resgrid.Web/Dockerfile index 4716226b5..6c0a853c5 100644 --- a/Web/Resgrid.Web/Dockerfile +++ b/Web/Resgrid.Web/Dockerfile @@ -20,6 +20,7 @@ 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 RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - RUN apt-get -y install nodejs ARG BUILD_VERSION @@ -61,6 +62,10 @@ RUN chmod +x /app/publish/wait FROM base AS final WORKDIR /app +## Copy the IANA timezone database. DHI/distroless bases ship without tzdata, +## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException. +COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo +ENV TZ=Etc/UTC COPY --from=publish /app/publish . # docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND. # These hardened (distroless) images have no shell, so we can't chain with "sh -c". diff --git a/Workers/Resgrid.Workers.Console/Dockerfile b/Workers/Resgrid.Workers.Console/Dockerfile index 433f0ad2f..cea9b7bb0 100644 --- a/Workers/Resgrid.Workers.Console/Dockerfile +++ b/Workers/Resgrid.Workers.Console/Dockerfile @@ -57,6 +57,7 @@ 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 \ @@ -73,6 +74,11 @@ COPY --from=publish /tmp/wkdeps/ /usr/local/lib/wkhtmltopdf/ COPY --from=publish /etc/fonts/ /etc/fonts/ COPY --from=publish /usr/share/fonts/ /usr/share/fonts/ +## Copy the IANA timezone database. DHI/distroless bases ship without tzdata, +## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException. +COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo +ENV TZ=Etc/UTC + ENV LD_LIBRARY_PATH="/usr/local/lib/wkhtmltopdf" COPY --from=publish /app/publish .