dotnet / sdk-container-builds

Libraries and build tooling to create container images from .NET projects using MSBuild

Home Page:https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DefaultRegistry does not work

tmds opened this issue · comments

A short-name base image like:

<ContainerBaseImage>ubuntu/dotnet-runtime:6.0-22.04_beta</ContainerBaseImage>

is meant to use the hard-coded DefaultRegistry of docker.io.
Instead, it treats ubuntu as the registry:

error MSB4018: The "CreateNewImage" task failed unexpectedly. [/home/tmds/repos/web/web.csproj]
error MSB4018: System.Net.Http.HttpRequestException: Name or service not known (ubuntu:443) [/home/tmds/repos/web/web.csproj]

We need to detect and insert a default registry here during parameter validation - we should default to either registry.hub.docker.com or registry-1.docker.io (the known docker hub aliases that actually follow the V2 API spec) here. The Docker tooling uses registry-1.docker.io here, so we should do the same.