Skip to content

Add --pull to Docker builds to ensure fresh base images - #4087

Merged
mattleibow merged 1 commit into
mainfrom
mattleibow/verbose-spoon
May 28, 2026
Merged

mattleibow merged 1 commit into
mainfrom
mattleibow/verbose-spoon

Conversation

@mattleibow

@mattleibow mattleibow commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Docker builds on CI agents reuse whatever base image layer is cached locally. Without --pull, the cached copy can lag behind MCR by days or weeks, so updates shipped in the .NET prereqs images never reach our builds until an agent happens to lose its cache.

Fix

Add --pull to both the 1ES.BuildContainerImage@1 and Docker@2 build commands so the agent always checks MCR for updated base images before building.

Trade-off: Adds a few seconds per build (registry metadata check), but ensures our containers always start from the latest upstream base layer.

@github-actions

github-actions Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4087

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4087"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4087/packages --name skiasharp-pr-4087
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4087

Without --pull, Docker reuses whatever base image layer is cached on
the build agent, which can lag behind the upstream MCR images by days
or weeks. This means patches, updates, and fixes shipped in the .NET
prereqs images never reach our builds until an agent happens to lose
its cache.

Add --pull to both the 1ES and non-1ES Docker build commands so the
agent always checks MCR for updated base images before building.

Co-authored-by: Copilot <[email protected]>
@mattleibow
mattleibow force-pushed the mattleibow/verbose-spoon branch from 869bb7d to 71aacf7 Compare May 28, 2026 03:45
@mattleibow mattleibow changed the title Fix stale Docker base image cache causing CVE-2025-1744 CG alert Add --pull to Docker builds to ensure fresh base images May 28, 2026
@mattleibow
mattleibow merged commit c9a6f8b into main May 28, 2026
3 of 4 checks passed
@mattleibow
mattleibow deleted the mattleibow/verbose-spoon branch May 28, 2026 03:46
mattleibow added a commit that referenced this pull request May 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

@mattleibow mattleibow added this to the 4.148.0-rc.1 milestone Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant