Skip to content

Commit b537f25

Browse files
committed
RE1-T117 Fixing docker container
1 parent ab4ffe1 commit b537f25

6 files changed

Lines changed: 37 additions & 0 deletions

File tree

Web/Resgrid.Web.Eventing/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,19 @@ WORKDIR "/src/Web/Resgrid.Web.Eventing"
2626

2727
FROM build AS publish
2828
ARG BUILD_VERSION
29+
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
30+
&& apt-get install -y --no-install-recommends tzdata \
31+
&& rm -rf /var/lib/apt/lists/*
2932
RUN dotnet publish "Resgrid.Web.Eventing.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
3033
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
3134
RUN chmod +x /app/publish/wait
3235

3336
FROM base AS final
3437
WORKDIR /app
38+
## Copy the IANA timezone database. DHI/distroless bases ship without tzdata,
39+
## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException.
40+
COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo
41+
ENV TZ=Etc/UTC
3542
COPY --from=publish /app/publish .
3643
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
3744
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".

Web/Resgrid.Web.Mcp/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,19 @@ WORKDIR "/src/Web/Resgrid.Web.Mcp"
3737

3838
FROM build AS publish
3939
ARG BUILD_VERSION
40+
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
41+
&& apt-get install -y --no-install-recommends tzdata \
42+
&& rm -rf /var/lib/apt/lists/*
4043
RUN dotnet publish "Resgrid.Web.Mcp.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
4144
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4245
RUN chmod +x /app/publish/wait
4346

4447
FROM base AS final
4548
WORKDIR /app
49+
## Copy the IANA timezone database. DHI/distroless bases ship without tzdata,
50+
## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException.
51+
COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo
52+
ENV TZ=Etc/UTC
4653
COPY --from=publish /app/publish .
4754
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
4855
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".

Web/Resgrid.Web.Services/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,19 @@ WORKDIR "/src/Web/Resgrid.Web.Services"
3737

3838
FROM build AS publish
3939
ARG BUILD_VERSION
40+
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
41+
&& apt-get install -y --no-install-recommends tzdata \
42+
&& rm -rf /var/lib/apt/lists/*
4043
RUN dotnet publish "Resgrid.Web.Services.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
4144
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4245
RUN chmod +x /app/publish/wait
4346

4447
FROM base AS final
4548
WORKDIR /app
49+
## Copy the IANA timezone database. DHI/distroless bases ship without tzdata,
50+
## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException.
51+
COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo
52+
ENV TZ=Etc/UTC
4653
COPY --from=publish /app/publish .
4754
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
4855
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".

Web/Resgrid.Web.Tts/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ RUN apt-get update \
3232
xz-utils \
3333
gzip \
3434
passwd \
35+
tzdata \
3536
&& rm -rf /var/lib/apt/lists/* \
3637
&& curl -fsSL --retry 3 --retry-delay 5 "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -o /tmp/ffmpeg.tar.xz \
3738
&& 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
9596
COPY --from=publish /tmp/ttsdeps/ /usr/local/lib/tts/
9697
COPY --from=publish /tmp/app-passwd /etc/passwd
9798
COPY --from=publish /tmp/app-group /etc/group
99+
## Copy the IANA timezone database. DHI/distroless bases ship without tzdata,
100+
## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException.
101+
COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo
102+
ENV TZ=Etc/UTC
98103
COPY --from=publish /app/publish .
99104

100105
ENV LD_LIBRARY_PATH="/usr/local/lib/tts"

Web/Resgrid.Web/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ 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
2324
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
2425
RUN apt-get -y install nodejs
2526
ARG BUILD_VERSION
@@ -61,6 +62,10 @@ RUN chmod +x /app/publish/wait
6162

6263
FROM base AS final
6364
WORKDIR /app
65+
## Copy the IANA timezone database. DHI/distroless bases ship without tzdata,
66+
## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException.
67+
COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo
68+
ENV TZ=Etc/UTC
6469
COPY --from=publish /app/publish .
6570
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
6671
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".

Workers/Resgrid.Workers.Console/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ RUN apt-get update \
5757
libxext6 \
5858
libxrender1 \
5959
zlib1g \
60+
tzdata \
6061
&& wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \
6162
&& dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb || apt-get install -fy \
6263
&& rm -f wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \
@@ -73,6 +74,11 @@ COPY --from=publish /tmp/wkdeps/ /usr/local/lib/wkhtmltopdf/
7374
COPY --from=publish /etc/fonts/ /etc/fonts/
7475
COPY --from=publish /usr/share/fonts/ /usr/share/fonts/
7576

77+
## Copy the IANA timezone database. DHI/distroless bases ship without tzdata,
78+
## so TimeZoneInfo (and TZConvert) can't resolve any zone -> TimeZoneNotFoundException.
79+
COPY --from=publish /usr/share/zoneinfo /usr/share/zoneinfo
80+
ENV TZ=Etc/UTC
81+
7682
ENV LD_LIBRARY_PATH="/usr/local/lib/wkhtmltopdf"
7783

7884
COPY --from=publish /app/publish .

0 commit comments

Comments
 (0)