Skip to content

Commit b94da09

Browse files
authored
Merge pull request #406 from Resgrid/develop
RE1-T117 Fixing timezone issue in docker
2 parents 0089d6a + 50e053f commit b94da09

6 files changed

Lines changed: 48 additions & 6 deletions

File tree

Web/Resgrid.Web.Eventing/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ WORKDIR "/src/Web/Resgrid.Web.Eventing"
2626

2727
FROM build AS publish
2828
ARG BUILD_VERSION
29+
## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the
30+
## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces
31+
## re-extraction; the test asserts the zone files are really present so the build
32+
## fails loudly instead of silently shipping an empty /usr/share/zoneinfo.
2933
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
30-
&& apt-get install -y --no-install-recommends tzdata \
34+
&& apt-get install -y --reinstall --no-install-recommends tzdata \
35+
&& test -f /usr/share/zoneinfo/America/New_York \
36+
&& test -f /usr/share/zoneinfo/Asia/Kolkata \
3137
&& rm -rf /var/lib/apt/lists/*
3238
RUN dotnet publish "Resgrid.Web.Eventing.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
3339
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait

Web/Resgrid.Web.Mcp/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ WORKDIR "/src/Web/Resgrid.Web.Mcp"
3737

3838
FROM build AS publish
3939
ARG BUILD_VERSION
40+
## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the
41+
## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces
42+
## re-extraction; the test asserts the zone files are really present so the build
43+
## fails loudly instead of silently shipping an empty /usr/share/zoneinfo.
4044
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
41-
&& apt-get install -y --no-install-recommends tzdata \
45+
&& apt-get install -y --reinstall --no-install-recommends tzdata \
46+
&& test -f /usr/share/zoneinfo/America/New_York \
47+
&& test -f /usr/share/zoneinfo/Asia/Kolkata \
4248
&& rm -rf /var/lib/apt/lists/*
4349
RUN dotnet publish "Resgrid.Web.Mcp.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
4450
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait

Web/Resgrid.Web.Services/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ WORKDIR "/src/Web/Resgrid.Web.Services"
3737

3838
FROM build AS publish
3939
ARG BUILD_VERSION
40+
## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the
41+
## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces
42+
## re-extraction; the test asserts the zone files are really present so the build
43+
## fails loudly instead of silently shipping an empty /usr/share/zoneinfo.
4044
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
41-
&& apt-get install -y --no-install-recommends tzdata \
45+
&& apt-get install -y --reinstall --no-install-recommends tzdata \
46+
&& test -f /usr/share/zoneinfo/America/New_York \
47+
&& test -f /usr/share/zoneinfo/Asia/Kolkata \
4248
&& rm -rf /var/lib/apt/lists/*
4349
RUN dotnet publish "Resgrid.Web.Services.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
4450
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait

Web/Resgrid.Web.Tts/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ RUN apt-get update \
3232
xz-utils \
3333
gzip \
3434
passwd \
35-
tzdata \
3635
&& rm -rf /var/lib/apt/lists/* \
3736
&& curl -fsSL --retry 3 --retry-delay 5 "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -o /tmp/ffmpeg.tar.xz \
3837
&& 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 \
8584
&& find /usr/local/lib -name '*.so*' -type f >> /tmp/ttsdeps/libs.txt \
8685
&& sort -u /tmp/ttsdeps/libs.txt | while read lib; do [ -f "$lib" ] && cp "$lib" /tmp/ttsdeps/; done
8786

87+
## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the
88+
## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces
89+
## re-extraction; the test asserts the zone files are really present so the build
90+
## fails loudly instead of silently shipping an empty /usr/share/zoneinfo.
91+
RUN apt-get update \
92+
&& apt-get install -y --reinstall --no-install-recommends tzdata \
93+
&& test -f /usr/share/zoneinfo/America/New_York \
94+
&& test -f /usr/share/zoneinfo/Asia/Kolkata \
95+
&& rm -rf /var/lib/apt/lists/*
96+
8897
FROM base AS final
8998
WORKDIR /app
9099

Web/Resgrid.Web/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ FROM dhi.io/dotnet:9.0.314-sdk-debian13@sha256:a3acd51de0af79878e26292b3053aab51
2020
#COPY --from=node_base /usr/local/bin /usr/local/bin
2121
RUN apt-get update
2222
RUN apt-get install -y ca-certificates curl gnupg
23-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
23+
## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the
24+
## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces
25+
## re-extraction; the test asserts the zone files are really present so the build
26+
## fails loudly instead of silently shipping an empty /usr/share/zoneinfo.
27+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall --no-install-recommends tzdata \
28+
&& test -f /usr/share/zoneinfo/America/New_York \
29+
&& test -f /usr/share/zoneinfo/Asia/Kolkata
2430
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
2531
RUN apt-get -y install nodejs
2632
ARG BUILD_VERSION

Workers/Resgrid.Workers.Console/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,23 @@ RUN apt-get update \
5757
libxext6 \
5858
libxrender1 \
5959
zlib1g \
60-
tzdata \
6160
&& wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \
6261
&& dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb || apt-get install -fy \
6362
&& rm -f wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \
6463
&& mkdir -p /tmp/wkdeps \
6564
&& ldd /usr/local/bin/wkhtmltopdf | awk '/=>/ {print $3}' | while read lib; do cp "$lib" /tmp/wkdeps/; done \
6665
&& apt-get clean && rm -rf /var/lib/apt/lists/*
6766

67+
## The hardened DHI image marks tzdata as installed (dpkg) but ships none of the
68+
## zone files, so a plain "apt-get install tzdata" is a no-op. --reinstall forces
69+
## re-extraction; the test asserts the zone files are really present so the build
70+
## fails loudly instead of silently shipping an empty /usr/share/zoneinfo.
71+
RUN apt-get update \
72+
&& apt-get install -y --reinstall --no-install-recommends tzdata \
73+
&& test -f /usr/share/zoneinfo/America/New_York \
74+
&& test -f /usr/share/zoneinfo/Asia/Kolkata \
75+
&& rm -rf /var/lib/apt/lists/*
76+
6877
FROM base AS final
6978
WORKDIR /app
7079

0 commit comments

Comments
 (0)