Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Web/Resgrid.Web.Eventing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion Web/Resgrid.Web.Mcp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion Web/Resgrid.Web.Services/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion Web/Resgrid.Web.Tts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion Web/Resgrid.Web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +27 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add apt lists cleanup to match other Dockerfiles.

All other Dockerfiles in this PR append && rm -rf /var/lib/apt/lists/* after the zoneinfo file checks to minimize layer size. This one is missing that cleanup step.

🧹 Proposed fix
 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
+    && test -f /usr/share/zoneinfo/Asia/Kolkata \
+    && rm -rf /var/lib/apt/lists/*
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Web/Resgrid.Web/Dockerfile` around lines 27 - 29, The RUN instruction
installing tzdata in the Dockerfile (the line invoking
DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall
--no-install-recommends tzdata and the subsequent test -f checks for zoneinfo
files) is missing the apt cache cleanup used in other Dockerfiles; update that
RUN chain to append && rm -rf /var/lib/apt/lists/* after the zoneinfo tests so
temporary apt lists are removed and the image layer size is minimized.

RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get -y install nodejs
ARG BUILD_VERSION
Expand Down
11 changes: 10 additions & 1 deletion Workers/Resgrid.Workers.Console/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,23 @@ 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 \
&& mkdir -p /tmp/wkdeps \
&& 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

Expand Down
Loading