Skip to content

Add initial version of Manifest V2 model - #2285

Merged
lbussell merged 106 commits into
dotnet:mainfrom
lbussell:lbussell/manifest-v2-model
Nov 20, 2026
Merged

lbussell merged 106 commits into
dotnet:mainfrom
lbussell:lbussell/manifest-v2-model

Conversation

@lbussell

Copy link
Copy Markdown
Member

This PR adds a draft of a new Manifest model with one key improvement (pun intended): images and platforms now have stable identifiers across builds.

The new model enforces this invariant by construction. As a result, the following things will be trivialized:

  • Matching up images between builds (using the stable key for the image).
  • Selecting which images to build (using the stable key for the image).
  • Determining when an image was skipped in a build versus when it is no longer supported.
  • etc.

This PR also adds basic structure for "preview" commands in ImageBuilder:

  • Preview commands only show up when the environment variable IMAGEBUILDER_PREVIEW is set to 1.
  • I added an example "list" command that lists all images defined by a manifest file that uses the new format.

In follow-up PRs, I will adopt more operations and commands to support the new models, either as new "preview" commands for large refactors, or as new behavior in existing commands switched on by IMAGEBUILDER_PREVIEW=1.

Since this is a big break for the model, I decided to keep it intentionally minimal to start, and add things as needed. Most omissions are intentional, and I will add things back as needed, only when they are needed. Examples of intentional omissions:

Other ideas I explored, which I ultimately decided were too complex to be worth it:

  • Adding cascading metadata and defaults to the manifest model.
  • A new "matrix" model for manifests.
  • manifest.yaml

The model only became simple once I resolved to push complexity into consuming repos (templating + facilitating huge matrixes of images, tagging patterns, etc.). Consuming repos are the best equipped to deal with complexity in the way that makes the most sense for their own scenarios. ImageBuilder's job is to be as flexible as possible in order to allow that to happen.


lbussell and others added 30 commits November 19, 2026 11:44
Replace manifest variables with metadata and add metadata to repos, images, and platforms.

Co-authored-by: Copilot App <[email protected]>
Use YAML anchors for reusable OS, platform, and version definitions. Resolve cascading defaults and metadata, tag dictionaries, and Dockerfile patterns into JSON. Expand the example to .NET 9.0 and 10.0 across four repositories, including ARM32 v7 and ARM64 v8 platforms.

Co-authored-by: Copilot App <[email protected]>
Remove unused servicing and channel metadata. Reuse the Nano Server platform group and an explicitly empty Windows shared-tag anchor. Align image ordering with dotnet-docker and regenerate the resolved JSON.

Co-authored-by: Copilot App <[email protected]>
Add supported Linux and Windows images for .NET 8.0 through 11.0 while preserving the model, resolver, and established defaults. Keep unsupported variants and tag-policy differences visible as inline TODOs in source order, and regenerate the resolved JSON.

Co-authored-by: Copilot App <[email protected]>
Compose Alpine floating tag aliases explicitly with the defaults and add the newly supported Alpine images. Align .NET 9 convenience tags with Bookworm, separate version groups, and shorten Alpine tag-anchor and Server Core identifiers while preserving published tags and Dockerfile paths.

Co-authored-by: Copilot App <[email protected]>
Use literal variant suffix metadata in tag and Dockerfile patterns. Add supported variants and explicitly composed SDK AOT convenience aliases, retain purpose-scoped platform helpers, and intentionally exclude build dependencies. Leave the runtime-deps Alpine undocumented aliases for a separate iteration.

Co-authored-by: Copilot App <[email protected]>
Add the .NET 8 and 9 undocumented AOT aliases using explicitly release-scoped shared and platform tag maps. Reuse common alias patterns through YAML merges, preserve the release-specific floating alias difference, and remove unused platform anchor labels left over from grouping.

Co-authored-by: Copilot App <[email protected]>
Shared and platform tags now share one namespace per repo, so two images
(or an image and a platform) that resolve to the same tag fail resolution
instead of silently publishing whichever push lands last.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Define the PowerShell version and per-platform download URL and digest for
each .NET version, and select the matching download on every SDK platform.
Alpine arm platforms explicitly have no PowerShell. Regenerate the resolved
manifest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Anchor each .NET product download (URL and checksum URL) by product,
version and RID, and have every runtime, aspnet and SDK platform that
downloads .NET reference exactly one under a dotnet key, the same way
SDK platforms reference PowerShell. runtime-deps and AOT SDK platforms
download nothing. Regenerate the resolved manifest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Platform definitions carry rid/psRid selector metadata; groups and images carry rid-keyed download maps. A null metadata value now removes an inherited key.

Co-authored-by: Copilot App <[email protected]>
Replace the rid/psRid selector pair with a single packageTarget key (os, libc, arch) shared by .NET and PowerShell download maps. Appliances key Aspire downloads by packageTarget and name the .NET Monitor URL variable dotnetRid.

Co-authored-by: Copilot App <[email protected]>
Split targetPlatform into os and arch on each platform, rename packageTarget to downloadKey, and bundle each product's version with its downloads. Repo groups now set product (what their images ship) and dotnet (the whole release) instead of separate version, runtime, aspnet and download keys. Version fields are shortened to major, minor, patch and build, and PowerShell has one version per release. AOT images no longer need a null metadata override, so InheritMetadata no longer removes keys.

Co-authored-by: Copilot App <[email protected]>
Move every .NET release into one dotnet metadata table keyed by release. Repo groups now set only version, which tags and paths use. Dockerfile templates know their product and read dotnet[version.minor].<product>.downloads[downloadKey], so composite images no longer override anything.

Co-authored-by: Copilot App <[email protected]>
Repos, groups and images now show only their own metadata. A platform shows its own metadata plus each inherited value that has placeholders, expanded for that platform. A template's metadata is the scope chain merged by key, so the values templates see are unchanged.

Co-authored-by: Copilot App <[email protected]>
Stop writing resolved JSON from the ManifestV2 example; it now only resolves and validates a manifest. Add TemplateTool, a dotnet tool project referencing the models with System.CommandLine and Fluid, not yet implemented. Add a sample repo with a .NET 10 noble manifest, the target Dockerfiles from dotnet-docker, placeholder templates, and generate.ps1.

Co-authored-by: Copilot App <[email protected]>
SDK templates read dotnet[version.minor].powershell, so sdk groups set only version like every other group.

Co-authored-by: Copilot App <[email protected]>
lbussell and others added 24 commits November 19, 2026 11:44
Load picks the format from the file extension. SerializeYaml and SerializeJson both leave out null and empty values, and both formats share the same validation.

Co-authored-by: Copilot App <[email protected]>
Keys are now built only by ImageEntry and PlatformEntry, so Validate no longer repeats the key format.

Co-authored-by: Copilot App <[email protected]>
Keys, references and platform enumeration move to extension members, and the entry doc comments are removed to match the other records.

Co-authored-by: Copilot App <[email protected]>
ImageKey and PlatformKey hold only the full key path, with no references to the manifest, so they compare and hash the same across manifests. Lookups are extension members on Manifest.

Co-authored-by: Copilot App <[email protected]>
- Drop YAML manifest support; the sample manifest is now manifest.json
- Let JsonException surface instead of rewrapping it
- Leave trailing newlines to callers that write files
- Allow uppercase in keys and name the key separator
- Describe digests without assuming sha256

Co-authored-by: Copilot App <[email protected]>
Manifest validation checks key parts and tag uniqueness per published
repo name. Image artifact details validation checks that every digest an
index lists belongs to a manifest. Drop null, digest format, platform
format, key format and at-least-one checks, the empty-collection omission
and GetManifests.

Co-authored-by: Copilot App <[email protected]>
Registered only when IMAGEBUILDER_PREVIEW=1.

Co-authored-by: Copilot App <[email protected]>
Remove Manifest.Readme, Repo.McrTagsMetadataTemplate,
ImagePlatform.UndocumentedTags and ImageManifest.CommitUrl.

Co-authored-by: Copilot App <[email protected]>
@lbussell
lbussell requested a review from a team as a code owner November 19, 2026 22:33
@lbussell
lbussell merged commit b7d0c46 into dotnet:main Nov 20, 2026
11 checks passed
@lbussell
lbussell deleted the lbussell/manifest-v2-model branch November 20, 2026 17:06
lbussell added a commit that referenced this pull request Nov 23, 2026
This PR adds a preview `merge` command, next to the preview `list`
command, that combines multiple `ImageArtifactDetails` files. Like the
`list` command, it is gated behind `IMAGEBUILDER_PREVIEW=1`.

Inputs must contain disjoint sets of manifests/indexes. If there are any
duplicate keys, an exception is thrown. This fits the "post-build merge"
scenario, because if the same image was built in multiple build legs, we
can't know which one to pick.

I also added property tests that cover merging disjoint inputs and
reporting duplicate keys.

Related: #2285

---------

Co-authored-by: Copilot App <[email protected]>
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.

2 participants