$ show dotnet/dotnet-docker
This repository is the official source for .NET Docker images published by Microsoft. It generates, builds, tests, and publishes container images for .NET SDK, runtime, ASP.NET Core, monitor, and other components across a wide matrix of .NET versions (8.0, 9.0, 10.0, 11.0 preview) and base operating systems (Alpine, Ubuntu, Debian, Azure Linux, Windows Nano Server/Server Core) for multiple architectures (amd64, arm32, arm64). The architecture is template-driven: Dockerfiles are generated from parameterized templates in `eng/dockerfile-templates/` using a custom Cottle-based engine, and version updates are automated via a CLI tool in `eng/update-dependencies/` that fetches build information from the .NET Build Asset Registry (BAR) and creates pull requests. The repository also includes extensive test infrastructure (xUnit tests, approval baselines) and CI/CD pipelines (Azure DevOps) that orchestrate image building, signing, scanning, and publishing to Microsoft Container Registry (MCR) and Docker Hub. Sample applications demonstrate usage patterns, and Kubernetes manifests illustrate deployment scenarios. The codebase is well-maintained, with active commits and issue triage, and exhibits low technical drift due to automated dependency management.
The LLM identified 4 files worth highlighting for reuse:
Entry point for the automated dependency update tool. Uses Microsoft.Extensions.DependencyInjection to register keyed services (IBuildUpdaterService, IDependencyVersionSource, IGitRepoHelperFactory) and dispatches commands (from-build, from-channel, from-staging-pipeline, etc.). Demonstrates a clean CLI architecture with separation of concerns, making it reusable as a template for other automated update tools.
PowerShell script that generates Dockerfiles from Cottle-based templates. It reads manifest.json, resolves variables, and produces per-OS/per-architecture Dockerfiles. The script is parameterized and idempotent, making it a reusable pattern for any template-driven code generation pipeline.
Provides a robust wrapper around the Docker CLI with retry logic, logging, and container lifecycle management (build, run, stop, remove). Includes methods for pulling images, running containers with arguments, and cleaning up resources. This is a reusable utility for any project that needs to interact with Docker in tests or automation.
A lightweight C# class for parsing and comparing .NET version strings (e.g., '8.0.30', '10.0.11-preview.7'). Used by both the update-dependencies tool and the test suite. Demonstrates a clean, reusable version abstraction that can be extracted into a standalone NuGet package.