-
-
Notifications
You must be signed in to change notification settings - Fork 79
RE1-T119 Migrating to Docker Hardened Images #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
| ARG BUILD_VERSION=3.5.0 | ||
|
|
||
| FROM mcr.microsoft.com/dotnet/runtime:9.0.3-noble-amd64 AS base | ||
| #FROM mcr.microsoft.com/dotnet/runtime:9.0.3-noble-amd64 AS base | ||
| FROM dhi.io/dotnet:9.0.16-debian13 AS base | ||
| ARG BUILD_VERSION | ||
| WORKDIR /app | ||
|
|
||
| FROM mcr.microsoft.com/dotnet/sdk:9.0.202-noble-amd64 AS build | ||
| #FROM mcr.microsoft.com/dotnet/sdk:9.0.202-noble-amd64 AS build | ||
| FROM dhi.io/dotnet:9.0.314-sdk-debian13 AS build | ||
|
Comment on lines
+5
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify the distro/package mismatch in this Dockerfile.
rg -n '^\s*FROM\s+dhi\.io/dotnet:.*debian13' Workers/Resgrid.Workers.Console/Dockerfile
rg -n 'wkhtmltox_.*jammy_amd64\.deb' Workers/Resgrid.Workers.Console/Dockerfile
# Expected: both patterns match -> mismatch confirmed.
# Follow-up: use a Debian-compatible wkhtmltopdf package/build path.Repository: Resgrid/Core Length of output: 331 Replace the Ubuntu Jammy-specific wkhtmltopdf package with a Debian 13-compatible version. The migration to Debian 13 base images (lines 5, 10) is incompatible with the Ubuntu Jammy-specific wkhtmltopdf package (lines 48, 57: 🤖 Prompt for AI Agents |
||
| ARG BUILD_VERSION | ||
| WORKDIR /src | ||
|
|
||
|
|
@@ -35,11 +37,10 @@ WORKDIR "/src/Workers/Resgrid.Workers.Console" | |
| FROM build AS publish | ||
| ARG BUILD_VERSION | ||
| RUN dotnet publish "Resgrid.Workers.Console.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION} | ||
| ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /app/publish/wait | ||
| RUN chmod +x /app/publish/wait | ||
|
|
||
| FROM base AS final | ||
| ## Add the wait script to the image | ||
| ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait wait | ||
| RUN chmod +x wait | ||
|
|
||
| WORKDIR /app | ||
|
|
||
|
|
@@ -65,4 +66,5 @@ RUN set -xe \ | |
|
|
||
| COPY --from=publish /app/publish . | ||
|
|
||
| ENTRYPOINT ["sh", "-c", "./wait && dotnet Resgrid.Workers.Console.dll"] | ||
| ENTRYPOINT ["./wait"] | ||
| CMD ["dotnet", "Resgrid.Workers.Console.dll"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Resgrid/Core
Length of output: 167
🏁 Script executed:
Repository: Resgrid/Core
Length of output: 1986
Pin all
dhi.ioimages by digest across the 6 migrated Dockerfiles.All
dhi.ioFROM statements currently use tags only, leaving builds mutable. A retag can silently change runtime bits. Pin each reference with@sha256:<digest>to ensure deterministic, reproducible builds:Suggested pattern
🤖 Prompt for AI Agents