dotnet / dotnet-docker

Docker images for .NET and the .NET Tools.
https://hub.docker.com/_/microsoft-dotnet
MIT License
4.47k stars 1.94k forks source link

Proposal for versioned samples images #4932

Closed lbussell closed 8 months ago

lbussell commented 1 year ago

Describe the Problem

Some customers have expressed the desire for accessing old versions of samples in the dotnet/samples repo. We want .NET 8.0 samples to be compatible with older samples versions but still want to publish new samples with the latest .NET Docker features/best practices.

Proposal

Tags

I have provided several examples of the proposed tagging scheme below. The list is not exhaustive, the idea is just to provide some examples of how we could publish different types of samples with this naming scheme.

Old Tags New Tags OS
aspnetapp, aspnetapp-alpine-amd64 aspnetapp, aspnetapp-8.0, aspnetapp-8.0-alpine3.18, aspnetapp-8.0-alpine3.18-amd64 Alpine 3.18
Not published aspnetapp-composite, aspnetapp-composite-8.0, aspnetapp-8.0-jammy-chiseled, aspnetapp-8.0-jammy-chiseled-amd64 Jammy Chiseled
Not published aspnetapp-aot, aspnetapp-aot-8.0, aspnetapp-aot-8.0-jammy-chiseled, aspnetapp-aot-8.0-jammy-chiseled-amd64 Jammy Chiseled
Not published aspnetapp-chiseled, aspnetapp-chiseled-8.0...
OR aspnetapp-distroless, aspnetapp-distroless-8.0...
Jammy Chiseled
etc.
dotnetapp dotnetapp, dotnetapp-alpine?, dotnetapp-8.0, dotnetapp-8.0-alpine3.18, dotnetapp-8.0-alpine3.18-amd64 Alpine 3.18
Not published dotnetapp-ubuntu-chiseled?, dotnetapp-8.0-jammy-chiseled, dotnetapp-8.0-jammy-chiseled, dotnetapp-8.0-jammy-chiseled-amd64 Jammy Chiseled
Not published dotnetapp-aot, dotnetapp-aot-8.0, dotnetapp-aot-8.0-jammy-chiseled, dotnetapp-aot-8.0-jammy-chiseled-amd64 Jammy Chiseled
lbussell commented 1 year ago

Updated the tag listings to include OS versions.

lbussell commented 11 months ago

Here is a greatly simplified proposal based on working with @richlander:

Old Tags New Tags OS
aspnetapp, aspnetapp-alpine-<arch> aspnetapp, aspnetapp-8.0, aspnetapp-8.0-alpine-<arch> Alpine
aspnetapp-chiseled, aspnetapp-chiseled-8.0, aspnetapp-chiseled-8.0-<arch> Ubuntu Chiseled
dotnetapp, dotnetapp-alpine-<arch> dotnetapp, dotnetapp-8.0, dotnetapp-8.0-alpine-<arch> Alpine
dotnetapp-chiseled, dotnetapp-chiseled-8.0, dotnetapp-8.0-chiseled-<arch> Ubuntu Chiseled

The intention of having a versioned multi-platform tag (e.g. aspnetapp-8.0) is so that in the future, it would be easy to compare samples across .NET versions to see startup time and/or size differences, using a simple and accessible tag. I am not super attached to that idea so I could be convinced to remove it.

lbussell commented 9 months ago

[Triage] After some discussion, we think it would be best to leave Alpine as default so that users can inspect the image with a shell. The Chiseled samples should not be shipped with the addition of a shell since that is a design goal for the Chiseled images and we want to accurately portray the final product that a user might get when using them.

richlander commented 9 months ago

Agree. I key change we need is to set the USER in the aspnetapp sample.

lbussell commented 9 months ago

Agree. I key change we need is to set the USER in the aspnetapp sample.

[Triage] We should leave the user as root in .NET 8 and switch it to non-root in .NET 9.

lbussell commented 8 months ago

Versioned samples and Ubuntu Chiseled are now available with https://github.com/dotnet/dotnet-docker/pull/5185

https://mcr.microsoft.com/en-us/product/dotnet/samples/about

docker pull mcr.microsoft.com/dotnet/samples:aspnetapp-chiseled-8.0

Image