dotnet / dotnet/sdk

io.containerd.image.name annotation using docker.io

Open
#50,634 15 comments 0 reactions 0 assignees View on GitHub
Area-Containers
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

In https://github.com/dotnet/sdk/pull/46467 `io.containerd.image.name` was introduced:

https://github.com/dotnet/sdk/blob/270865c5d3d434bdf4faa2ee096fbb3cae896117/src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs#L108

Currently this is hard coded to `docker.io`:

https://github.com/dotnet/sdk/blob/270865c5d3d434bdf4faa2ee096fbb3cae896117/src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs#L95

I wonder if this shouldn't be using the registry that is being pushed to?

I unexpectedly saw this `docker.io` prefix show up when I did the following:
```
dotnet publish /t:PublishContainer /p:ContainerBaseImage=registry.access.redhat.com/ubi8/dotnet-90-runtime /p:ContainerRepository=app /p:ContainerArchiveOutputPath=app-image.tar -v d
podman load -i app-image.tar
```

Podman then says:
```
Loaded image: docker.io/library/app:latest
```

@dotnet/sdk-container-builds-maintainers ptal.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs around lines 95 and 108, then reproduce the issue with the dotnet publish and podman load commands in the report. Trace how the target registry is represented and verify that the generated image annotation and loaded image name use it instead of a hard-coded docker.io value.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.