dotnet / dotnet/dotnet-docker

ASP.NET Composite runtime and non-composite .NET runtime versions are out of sync for some preview versions

Open
#4,834 10 comments 1 reaction 0 assignees View on GitHub
area-dockerfiles
Dominant language
Dockerfile
Stars
4.9k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
26

Description

This is because the version of the composite runtime and the normal runtime are built from different locations. During preview dependency flows, the versions can get out of sync until the product is locked down for the next preview.

You can see this today:
```
> docker pull mcr.microsoft.com/dotnet/nightly/aspnet:8.0-alpine3.18-composite-amd64
digest: sha256:6a39b9c4d3e9e0c24ebb6432ff90e81f00b011ac6683f946eae78c179440eb71

> docker run --rm --entrypoint "/bin/sh" mcr.microsoft.com/dotnet/nightly/aspnet:8.0-alpine3.18-composite-amd64 -c 'echo $DOTNET_VERSION'
8.0.0-rc.1.23414.4

> docker run --rm --entrypoint "/bin/sh" mcr.microsoft.com/dotnet/nightly/aspnet:8.0-alpine3.18-composite-amd64 -c 'dotnet --list-runtimes | grep "Microsoft.NETCore.App"'
Microsoft.NETCore.App 8.0.0-rc.1.23414.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
```

The current test infrastructure has bugs for composite images that don't correctly test this environment variable: https://github.com/dotnet/dotnet-docker/issues/4827

When this is fixed the test will always fail when this variable is incoherent between the runtime and aspnet composite runtime images. Ideally we would compute the correct DOTNET_VERSION environment variable to use for the composite images, so that even if they're different between different image versions, the environment variable correctly describes which runtime version is in the Docker image.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.