Skip to content

Container base image inference uses wrong Ubuntu codename for .NET 11 #53553

Closed as duplicate

Description

@lbussell

Summary

When publishing a trimmed or AOT container image targeting .NET 11, the SDK infers the wrong Ubuntu codename for the base image tag. It produces noble-chiseled (Ubuntu 24.04) instead of resolute-chiseled (Ubuntu 26.04), resulting in a CONTAINER1015 error because the tag doesn't exist on MCR.

The root cause is UbuntuCodenameForSDKVersion in ComputeDotnetBaseImageAndTag.cs, which only knows about "jammy" (< 8.0.300) and "noble" (>= 8.0.300). Since the .NET 11 SDK version (11.0.100) satisfies >= 8.0.300, it returns "noble", but .NET 11 preview images on MCR use "resolute".

This only affects the auto-inference path (trimmed/AOT without an explicit ContainerFamily). Framework-dependent publishing and explicit ContainerFamily=resolute-chiseled both work fine.

Repro steps

  1. Install .NET 11 SDK preview (e.g. 11.0.100-preview.2)
  2. Create a console app:
dotnet new console --framework net11.0
  1. Publish as a trimmed container:
dotnet publish --os linux -t:PublishContainer -p:PublishTrimmed=true -p:SelfContained=true

Expected result

The SDK should infer a base image tag using resolute-chiseled (or resolute-chiseled-extra), matching what is actually published on MCR for .NET 11.

Actual result

error CONTAINER1015: Unable to access the repository 'dotnet/runtime-deps' at tag
'11.0.0-preview.2-noble-chiseled-extra' in the registry ''. Please confirm that this
name and tag are present in the registry.

Workaround

Set ContainerFamily explicitly:

dotnet publish --os linux -t:PublishContainer -p:PublishTrimmed=true -p:SelfContained=true -p:ContainerFamily=resolute-chiseled-extra

Additional notes

  • The code in question is UbuntuCodenameForSDKVersion. It needs to be updated to return "resolute" for SDK versions >= 11.0.100.
  • There is a related design issue: the method keys off the SDK version, not the TFM. This means that if a user builds a .NET 10 app with the .NET 11 SDK, they could get a "resolute" tag that doesn't exist for .NET 10. A more robust fix might key the codename off the target framework version instead of (or in addition to) the SDK version.
  • Framework-dependent publish (no trimming/AOT) is not affected because it doesn't include a Ubuntu codename in the tag.
  • Explicit ContainerFamily is not affected because it bypasses the codename inference.

/cc @baronfel

Activity

  1. self-assigned this
    on Mar 20, 2026
  2. added
    untriaged
    on Mar 20, 2026
  3. added
    Area-Containers
    on Mar 20, 2026
  4. removed
    untriaged
    on Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-Containers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions