Skip to content

Conversation

@lbussell
Copy link
Member

Fixes #1593.

Before/After

Example from dotnet/dotnet-docker/nightly > README.runtime.md:

Before

Nano Server 2025 amd64 Tags

Tag Dockerfile
10.0.1-nanoserver-ltsc2025, 10.0-nanoserver-ltsc2025 Dockerfile
9.0.11-nanoserver-ltsc2025, 9.0-nanoserver-ltsc2025 Dockerfile
8.0.22-nanoserver-ltsc2025, 8.0-nanoserver-ltsc2025 Dockerfile

.NET 11 Preview Tags

Tag Dockerfile
11.0.0-alpha.1-nanoserver-ltsc2025, 11.0-preview-nanoserver-ltsc2025 Dockerfile

Windows Server Core 2025 amd64 Tags

Tag Dockerfile
10.0.1-windowsservercore-ltsc2025, 10.0-windowsservercore-ltsc2025 Dockerfile
9.0.11-windowsservercore-ltsc2025, 9.0-windowsservercore-ltsc2025 Dockerfile
8.0.22-windowsservercore-ltsc2025, 8.0-windowsservercore-ltsc2025 Dockerfile

.NET 11 Preview Tags

Tag Dockerfile
11.0.0-alpha.1-windowsservercore-ltsc2025, 11.0-preview-windowsservercore-ltsc2025 Dockerfile

Nano Server 2022 amd64 Tags

Tag Dockerfile
10.0.1-nanoserver-ltsc2022, 10.0-nanoserver-ltsc2022 Dockerfile
9.0.11-nanoserver-ltsc2022, 9.0-nanoserver-ltsc2022 Dockerfile
8.0.22-nanoserver-ltsc2022, 8.0-nanoserver-ltsc2022 Dockerfile

Windows Server Core 2022 amd64 Tags

Tag Dockerfile
10.0.1-windowsservercore-ltsc2022, 10.0-windowsservercore-ltsc2022 Dockerfile
9.0.11-windowsservercore-ltsc2022, 9.0-windowsservercore-ltsc2022 Dockerfile
8.0.22-windowsservercore-ltsc2022, 8.0-windowsservercore-ltsc2022 Dockerfile

Nano Server, version 1809 amd64 Tags

Tag Dockerfile
9.0.11-nanoserver-1809, 9.0-nanoserver-1809 Dockerfile
8.0.22-nanoserver-1809, 8.0-nanoserver-1809 Dockerfile

Windows Server Core 2019 amd64 Tags

Tag Dockerfile
9.0.11-windowsservercore-ltsc2019, 9.0-windowsservercore-ltsc2019 Dockerfile
8.0.22-windowsservercore-ltsc2019, 8.0-windowsservercore-ltsc2019 Dockerfile
After

Windows amd64 Tags

Tags Dockerfile OS Version
10.0.1-nanoserver-ltsc2025, 10.0-nanoserver-ltsc2025 Dockerfile Nano Server 2025
10.0.1-windowsservercore-ltsc2025, 10.0-windowsservercore-ltsc2025 Dockerfile Windows Server Core 2025
9.0.11-nanoserver-ltsc2025, 9.0-nanoserver-ltsc2025 Dockerfile Nano Server 2025
9.0.11-windowsservercore-ltsc2025, 9.0-windowsservercore-ltsc2025 Dockerfile Windows Server Core 2025
8.0.22-nanoserver-ltsc2025, 8.0-nanoserver-ltsc2025 Dockerfile Nano Server 2025
8.0.22-windowsservercore-ltsc2025, 8.0-windowsservercore-ltsc2025 Dockerfile Windows Server Core 2025
10.0.1-nanoserver-ltsc2022, 10.0-nanoserver-ltsc2022 Dockerfile Nano Server 2022
10.0.1-windowsservercore-ltsc2022, 10.0-windowsservercore-ltsc2022 Dockerfile Windows Server Core 2022
9.0.11-nanoserver-ltsc2022, 9.0-nanoserver-ltsc2022 Dockerfile Nano Server 2022
9.0.11-windowsservercore-ltsc2022, 9.0-windowsservercore-ltsc2022 Dockerfile Windows Server Core 2022
8.0.22-nanoserver-ltsc2022, 8.0-nanoserver-ltsc2022 Dockerfile Nano Server 2022
8.0.22-windowsservercore-ltsc2022, 8.0-windowsservercore-ltsc2022 Dockerfile Windows Server Core 2022
9.0.11-nanoserver-1809, 9.0-nanoserver-1809 Dockerfile Nano Server, version 1809
9.0.11-windowsservercore-ltsc2019, 9.0-windowsservercore-ltsc2019 Dockerfile Windows Server Core 2019
8.0.22-nanoserver-1809, 8.0-nanoserver-1809 Dockerfile Nano Server, version 1809
8.0.22-windowsservercore-ltsc2019, 8.0-windowsservercore-ltsc2019 Dockerfile Windows Server Core 2019

.NET 11 Preview Tags

Tags Dockerfile OS Version
11.0.0-alpha.1-nanoserver-ltsc2025, 11.0-preview-nanoserver-ltsc2025 Dockerfile Nano Server 2025
11.0.0-alpha.1-windowsservercore-ltsc2025, 11.0-preview-windowsservercore-ltsc2025 Dockerfile Windows Server Core 2025

AI-generated summary:

This pull request refactors and improves the logic for generating README tag listing tables in the image builder. The main changes include moving the McrTagsMetadataGenerator to a new namespace, simplifying and restructuring the code for generating markdown tables from MCR tags metadata, and introducing extension methods for repo name parsing. These updates make the codebase more modular, readable, and easier to maintain, while also enhancing the clarity of the generated documentation.

Refactoring and Code Organization:

  • Moved McrTagsMetadataGenerator to the new namespace Microsoft.DotNet.ImageBuilder.Mcr, updating all relevant imports across the codebase. [1] [2] [3] [4]

Markdown Table Generation Improvements:

  • Refactored the tags listing logic in GenerateReadmesCommand to group tag metadata by OS and architecture, and to generate markdown tables with improved structure and readability. The new approach uses the TagsTable record for organizing tables and supports nested sub-tables for custom tag groups.

Extension Methods for Repo Name Parsing:

  • Replaced static helper methods with extension methods GetParentRepoName and GetShortName for parsing hierarchical repo names, improving code clarity and reuse.

Documentation and Comments:

  • Added detailed XML documentation comments to key methods and records in GenerateReadmesCommand, clarifying their responsibilities and usage. [1] [2] [3]

Code Simplification and Cleanup:

  • Removed legacy table header constants and outdated helper classes, consolidating table formatting logic into the new markdown generation flow. [1] [2]

@lbussell lbussell requested a review from a team as a code owner January 12, 2026 22:01
@MichaelSimons
Copy link
Member

Thanks for working on this! The order in the tags table is slightly different than I was expecting and feels inconsistent with Linux. Is that an artifact of running these changes with the current sdk-tags.yml metadata template? I was expecting all 10.0 tags to be listed then 9.0, etc. I was expecting the sort order should be .NET version desc, OS variant asc, OS version desc.

@lbussell
Copy link
Member Author

Thanks for working on this! The order in the tags table is slightly different than I was expecting and feels inconsistent with Linux. Is that an artifact of running these changes with the current sdk-tags.yml metadata template? I was expecting all 10.0 tags to be listed then 9.0, etc. I was expecting the sort order should be .NET version desc, OS variant asc, OS version desc.

@MichaelSimons Yes. We control the sorting in the dotnet-docker repo. We can re-order them any way we'd like from the mcr-tags-metadata files. I agree that sorting by .NET and then by OS makes more sense and is more consistent with Linux tags tables.

@lbussell
Copy link
Member Author

This still needs to be tested in https://github.com/microsoft/dotnet-framework-docker where there are multi-platform tags for Windows images. Or maybe even add a test case for that scenario.

@lbussell lbussell requested a review from Copilot January 12, 2026 22:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@lbussell
Copy link
Member Author

@mthalman @MichaelSimons Here is the .NET Framework Readme before/after. I think it is a significant improvement in readability.

.NET Framework Before

Full Tag Listing

Windows Server Core 2025 amd64 Tags

Tag Dockerfile
4.8.1-20251014-windowsservercore-ltsc2025, 4.8.1-windowsservercore-ltsc2025, 4.8.1 Dockerfile

Windows Server Core 2022 amd64 Tags

Tag Dockerfile
4.8.1-20251014-windowsservercore-ltsc2022, 4.8.1-windowsservercore-ltsc2022, 4.8.1 Dockerfile

Windows Server Core 2019 amd64 Tags

Tag Dockerfile
4.8-20251014-windowsservercore-ltsc2019, 4.8-windowsservercore-ltsc2019, 4.8, latest Dockerfile

Windows Server Core 2016 amd64 Tags

Tag Dockerfile
4.8-20251014-windowsservercore-ltsc2016, 4.8-windowsservercore-ltsc2016, 4.8, latest Dockerfile
.NET Framework After

Full Tag Listing

Windows amd64 Tags

Tags Dockerfile OS Version
4.8.1-20251014-windowsservercore-ltsc2025, 4.8.1-windowsservercore-ltsc2025, 4.8.1 Dockerfile Windows Server Core 2025
4.8.1-20251014-windowsservercore-ltsc2022, 4.8.1-windowsservercore-ltsc2022, 4.8.1 Dockerfile Windows Server Core 2022
4.8-20251014-windowsservercore-ltsc2019, 4.8-windowsservercore-ltsc2019, 4.8, latest Dockerfile Windows Server Core 2019
4.8-20251014-windowsservercore-ltsc2016, 4.8-windowsservercore-ltsc2016, 4.8, latest Dockerfile Windows Server Core 2016

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.

Treat Windows tags more like Linux tags in generated tags tables

2 participants