dotnet / dotnet/sdk

Incorrect Ubuntu Codename selected for .NET 11 builds

Open
#53,370 0 comments 1 reaction 1 assignee Claimed by @lbussell View on GitHub
Area-Containers
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
When attempting to use the SDK container build support in the .NET 11 previews, I get the error:
```
error CONTAINER1015: Unable to access the repository 'dotnet/runtime-deps' at tag '11.0.0-preview.2-noble-chiseled' in the registry ''. Please confirm that this name and tag are present in the registry.
```

This is due to the ubuntu codename changing for the .NET 11 images from noble to resolute.

### To Reproduce

Trying an SDK container build using the ubuntu images was enough to trigger for me.

Here's a minimal single-file reproduction (Single-file-ized output of `dotnet new webapiaot`), you can trigger the issue by publishing this with `dotnet publish ./Program.cs /t:PublishContainer`

```csharp
#:sdk Microsoft.NET.Sdk.Web

#:property ContainerRegistry=ghcr.io
#:property ContainerRepository=hwoodiwiss/ReproSdk53370
#:property EnableSdkContainerSupport=true
#:property PublishAot=true

using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Http.HttpResults;

var builder = WebApplication.CreateSlimBuilder(args);

builder.Services.ConfigureHttpJsonOptions(options =>
{
options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
});

var app = builder.Build();

Todo[] sampleTodos =
[
new(1, "Walk the dog"),
new(2, "Do the dishes", DateOnly.FromDateTime(DateTime.Now)),
new(3, "Do the laundry", DateOnly.FromDateTime(DateTime.Now.AddDays(1))),
new(4, "Clean the bathroom"),
new(5, "Clean the car", DateOnly.FromDateTime(DateTime.Now.AddDays(2)))
];

var todosApi = app.MapGroup("/todos");
todosApi.MapGet("/", () => sampleTodos)
.WithName("GetTodos");

todosApi.MapGet("/{id}", Results, NotFound> (int id) =>
sampleTodos.FirstOrDefault(a => a.Id == id) is { } todo
? TypedResults.Ok(todo)
: TypedResults.NotFound())
.WithName("GetTodoById");

app.Run();

public record Todo(int Id, string? Title, DateOnly? DueBy = null, bool IsComplete = false);

[JsonSerializable(typeof(Todo[]))]
internal partial class AppJsonSerializerContext : JsonSerializerContext;
```

### Further technical details
TBD, I'll need to run `dotnet --info` on the GHA runner that I saw the issue on.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.