Skip to content

chore: migrate base images to Chainguard - #1

Open
sachin-spotdraft wants to merge 2 commits into
masterfrom
chore/chainguard-base-images
Open

chore: migrate base images to Chainguard#1
sachin-spotdraft wants to merge 2 commits into
masterfrom
chore/chainguard-base-images

Conversation

@sachin-spotdraft

@sachin-spotdraft sachin-spotdraft commented Aug 5, 2026

Copy link
Copy Markdown

User description

Summary

  • Replaces public Docker base images with Chainguard equivalents from cgr.dev/spotdraft.com
  • FIPS variants used where available
  • Build stages: :latest-dev (includes shell)
  • Runtime stages: :latest (minimal, no shell)
  • Platform pinned to linux/amd64

Images updated

See Dockerfile diffs above.

🤖 Generated by chainguard-migrate.sh


Generated description

Below is a concise technical summary of the changes proposed in this PR:
Migrate the production container base from Microsoft’s ASP.NET image to the Chainguard .NET runtime image. Pin the build platform to linux/amd64 while preserving the application entrypoint and runtime deployment flow.

Latest Contributors(2)
UserCommitDate
sachin.rathod@spotdraf...chore: fix base image ...August 05, 2026
madhav@spotdraft.comAdd dockerfile and git...September 22, 2022
Review this PR on Baz | Customize your next review

Replace public base images with Chainguard equivalents from cgr.dev/spotdraft.com.
- Uses -fips variants where available
- Build stages use :latest-dev (shell available)
- Runtime stages use :latest (minimal)
- Platform pinned to linux/amd64
Comment thread Dockerfile Outdated
# Stage 1: Define base image that will be used for production

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM --platform=linux/amd64 cgr.dev/spotdraft.com/dotnet-runtime:6.0-dev AS base

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

base pulls the mutable, dev-tooling cgr.dev/spotdraft.com/dotnet-runtime:6.0-dev tag and final inherits from it, so production is deployed with dev tooling and its runtime can change silently whenever :6.0-dev is retagged, since .github/workflows/main.yaml neither pins nor verifies its digest — should we switch base to the approved non-dev runtime tag pinned to its reviewed digest (moving any build-only tools to a separate -dev stage) and add signature/provenance verification in the pipeline?

Severity web_search

Want Baz to fix this for you? Activate Fixer

Fix in Cursor

Prompt for AI Agents
Before applying, verify this suggestion against the current code. In Dockerfile around
line 3 (`FROM --platform=linux/amd64 cgr.dev/spotdraft.com/dotnet-runtime:6.0-dev AS
base`), the `base` stage is inherited by `final`, so production deploys with dev tooling
and is exposed to a mutable, unverified tag. Fix by switching `base` to the approved
non-dev runtime tag pinned to its exact reviewed digest (moving any build-only tools
needed for `dotnet publish` into a separate `-dev` stage used only during build), and
update `.github/workflows/main.yaml` to verify image provenance/signature (e.g.
cosign/SLSA) for the pinned base before building/pushing. Confirm no other stage still
propagates the `-dev` tag into `final`, and keep base selection consistent across stages
so the final image is reproducibly tied to the reviewed digest.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Commit 45b071a addressed this comment by switching the production base from a dev/runtime image to a non-dev dotnet-runtime image. However, it still uses the mutable :latest tag and adds no digest pinning or provenance/signature verification.

@sachin-spotdraft

Copy link
Copy Markdown
Author

⚠️ The following image tags are not yet available in our Chainguard catalog / AR — manual review needed:

  • cgr.dev/spotdraft.com/dotnet-runtime:6.0-dev

These Dockerfile lines were left unchanged.

Comment thread Dockerfile
# Stage 1: Define base image that will be used for production

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM --platform=linux/amd64 us-central1-docker.pkg.dev/spotdraft-qa/sd-us-chainguard/dotnet-runtime:latest AS base

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This FROM switches to a private us-central1-docker.pkg.dev/.../dotnet-runtime:latest image, but .github/workflows/main.yaml only authenticates to ghcr.io, so docker/build-push-action will fail with a 401 while resolving the base image. Even if pulled, that image is runtime-only and lacks Microsoft.AspNetCore.App, which datadog-rum-proxy.csproj (targeting net6.0 with Microsoft.NET.Sdk.Web) needs for its framework-dependent publish, so dotnet datadog-rum-proxy.dll would fail with a missing framework error — should we add scoped Artifact Registry auth to the workflow and switch to an ASP.NET-capable, version-pinned image (or publish self-contained)?

Severity web_search

Want Baz to fix this for you? Activate Fixer

Fix in Cursor

Prompt for AI Agents
Before applying, verify this suggestion against the current code. In Dockerfile around
line 3 (`FROM --platform=linux/amd64
us-central1-docker.pkg.dev/.../dotnet-runtime:latest AS base`), two issues need
addressing: 1. Authentication: The build depends on a private Google Artifact Registry
image, but `.github/workflows/main.yaml` only authenticates to `ghcr.io` before
`docker/build-push-action` runs. Update the workflow to authenticate to the Artifact
Registry repository (via service account/Workload Identity) with scoped read permission
for the `us-central1` repo, or switch to a publicly pullable, approved base image (e.g.,
the existing `mcr.microsoft.com/...` one) if auth isn't feasible. 2. Runtime
compatibility: `datadog-rum-proxy.csproj` targets `net6.0` with `Microsoft.NET.Sdk.Web`
and is framework-dependent published, but the `dotnet-runtime` image lacks the
`Microsoft.AspNetCore.App` shared framework needed to run it. Replace the base image
with an ASP.NET-capable image explicitly pinned to a .NET 6.x version (providing
`Microsoft.AspNetCore.App`), ensuring the subsequent stage still runs the same published
`datadog-rum-proxy.dll` entrypoint. Alternatively, change the build/publish to produce a
self-contained deployment for .NET 6 and copy/run that self-contained output instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant