Skip to content

Import missing platforms for manifest list creation during partial builds - #2128

Merged
lbussell merged 5 commits into
dotnet:mainfrom
lbussell:issue-2107
May 28, 2026
Merged

lbussell merged 5 commits into
dotnet:mainfrom
lbussell:issue-2107

Conversation

@lbussell

Copy link
Copy Markdown
Member

This PR is intended to fix #2107.

In ImageBuilder's createManifestLists command:

  • Calculate which image platforms weren't built during the build and then import them, so that they are present for manifest list creation.
  • Treat the imported images as "unchanged", meaning they'll be excluded from publishing operations. This is the same mechanism that's used for cache hits during builds.

@lbussell
lbussell requested a review from a team as a code owner May 27, 2026 01:58

foreach (PlatformImportData platformToImport in platformsToImport)
{
await ImportPlatformToStagingAsync(platformToImport);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to include a logging message here indicating the reason for the import happening due to missing platform. The import image logic has its own logging but there's no context as to why. That would create dual logging for each platform. The other option would be to have a summary logging at the start saying something like "Importing X missing platforms"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. In an earlier draft I had some logging here but removed it specifically because it said basically the same thing as the CopyImageService's own logging. But there's probably an opportunity to make it clearer what's going on/why a given image is being imported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 5e754e4 and d59e7dd, and example logging output in separate comment below.

@lbussell

Copy link
Copy Markdown
Member Author

Hold on further review while I do some more validation.

@lbussell

Copy link
Copy Markdown
Member Author

It does what I expect. Here's some example logging output that I captured from a local dry-run, using the samples pipeline run that only built Windows images.

Logging output
13:02:24 info: Microsoft.DotNet.ImageBuilder.ManifestJsonService[0] READING MANIFEST
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] CREATING MANIFEST LISTS
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Looking for platforms missing from the current build.
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [dotnetapp-10.0,dotnetapp,latest] Built 1/4 platforms (missing 3 platforms)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [dotnetapp-10.0,dotnetapp,latest] Has platform linux/amd64, WasBuilt=False
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [dotnetapp-10.0,dotnetapp,latest] Has platform linux/arm/v7, WasBuilt=False
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [dotnetapp-10.0,dotnetapp,latest] Has platform linux/arm64/v8, WasBuilt=False
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [dotnetapp-10.0,dotnetapp,latest] Has platform windows/amd64, WasBuilt=True
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Resolving digest for image [dotnetapp-10.0,dotnetapp,latest] platform linux/amd64 from mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-amd64
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetching manifest for reference: mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-amd64
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.HttpClientProvider.LoggingHandler[0] HTTP 200 GET https://mcr.microsoft.com/v2/dotnet/samples/manifests/dotnetapp-10.0-alpine-amd64 in 00:00:00.5195929
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetched manifest: mediaType=application/vnd.docker.distribution.manifest.v2+json, digest=sha256:919a77c2b78e16b4f6579c985491466347b2cb0a01374b38ae8bcf4ea7bc1bf8, size=1780 in 00:00:00.5410346
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Resolving digest for image [dotnetapp-10.0,dotnetapp,latest] platform linux/arm/v7 from mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm32v7
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetching manifest for reference: mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm32v7
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.HttpClientProvider.LoggingHandler[0] HTTP 200 GET https://mcr.microsoft.com/v2/dotnet/samples/manifests/dotnetapp-10.0-alpine-arm32v7 in 00:00:00.0323648
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetched manifest: mediaType=application/vnd.docker.distribution.manifest.v2+json, digest=sha256:410cc283c517e988815a8c0667a78170b4b19d61090c0a980bca3cdda00bceae, size=1779 in 00:00:00.0328828
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Resolving digest for image [dotnetapp-10.0,dotnetapp,latest] platform linux/arm64/v8 from mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm64v8
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetching manifest for reference: mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm64v8
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.HttpClientProvider.LoggingHandler[0] HTTP 200 GET https://mcr.microsoft.com/v2/dotnet/samples/manifests/dotnetapp-10.0-alpine-arm64v8 in 00:00:00.0364062
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetched manifest: mediaType=application/vnd.docker.distribution.manifest.v2+json, digest=sha256:b5254d7edfc5bec50f80dd30280c8b25437e3fc0fda0af3038247fa44ba4051d, size=1780 in 00:00:00.0369530
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [aspnetapp-10.0,aspnetapp] Built 1/4 platforms (missing 3 platforms)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [aspnetapp-10.0,aspnetapp] Has platform linux/amd64, WasBuilt=False
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [aspnetapp-10.0,aspnetapp] Has platform linux/arm/v7, WasBuilt=False
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [aspnetapp-10.0,aspnetapp] Has platform linux/arm64/v8, WasBuilt=False
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] => Image [aspnetapp-10.0,aspnetapp] Has platform windows/amd64, WasBuilt=True
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Resolving digest for image [aspnetapp-10.0,aspnetapp] platform linux/amd64 from mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-amd64
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetching manifest for reference: mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-amd64
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.HttpClientProvider.LoggingHandler[0] HTTP 200 GET https://mcr.microsoft.com/v2/dotnet/samples/manifests/aspnetapp-10.0-alpine-amd64 in 00:00:00.0345637
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetched manifest: mediaType=application/vnd.docker.distribution.manifest.v2+json, digest=sha256:72d3cf8495b5d42cdbb3cc3246585dff7b4f832d69689e7fa4dd8c193f5f776e, size=1994 in 00:00:00.0354037
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Resolving digest for image [aspnetapp-10.0,aspnetapp] platform linux/arm/v7 from mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm32v7
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetching manifest for reference: mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm32v7
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.HttpClientProvider.LoggingHandler[0] HTTP 200 GET https://mcr.microsoft.com/v2/dotnet/samples/manifests/aspnetapp-10.0-alpine-arm32v7 in 00:00:00.0305390
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetched manifest: mediaType=application/vnd.docker.distribution.manifest.v2+json, digest=sha256:768afdbe228b285ae163ace0e40c6b8498ac14473436bcd750f08134d39f1526, size=1993 in 00:00:00.0321785
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Resolving digest for image [aspnetapp-10.0,aspnetapp] platform linux/arm64/v8 from mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm64v8
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetching manifest for reference: mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm64v8
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.HttpClientProvider.LoggingHandler[0] HTTP 200 GET https://mcr.microsoft.com/v2/dotnet/samples/manifests/aspnetapp-10.0-alpine-arm64v8 in 00:00:00.0323067
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] Fetched manifest: mediaType=application/vnd.docker.distribution.manifest.v2+json, digest=sha256:b1f8f81c5f6350b120dd41c821a8aa3eae061a25ff7111fd300552b6318496f5, size=1994 in 00:00:00.0329896
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Found 6 platforms to import.
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Importing platform linux/amd64 for multi-platform image [dotnetapp-10.0,dotnetapp,latest].
13:02:24 info: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] mcr.microsoft.com/dotnet/samples@sha256:919a77c2b78e16b4f6579c985491466347b2cb0a01374b38ae8bcf4ea7bc1bf8 has 0 referrer(s) (DryRun=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.CopyImageService[0] Importing 'mcr.microsoft.com.azurecr.io/dotnet/samples:dotnetapp-10.0-alpine-amd64' and 0 referrer(s) from 'mcr.microsoft.com/dotnet/samples@sha256:919a77c2b78e16b4f6579c985491466347b2cb0a01374b38ae8bcf4ea7bc1bf8' (DryRun=True, CopyReferrers=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Importing platform linux/arm/v7 for multi-platform image [dotnetapp-10.0,dotnetapp,latest].
13:02:24 info: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] mcr.microsoft.com/dotnet/samples@sha256:410cc283c517e988815a8c0667a78170b4b19d61090c0a980bca3cdda00bceae has 0 referrer(s) (DryRun=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.CopyImageService[0] Importing 'mcr.microsoft.com.azurecr.io/dotnet/samples:dotnetapp-10.0-alpine-arm32v7' and 0 referrer(s) from 'mcr.microsoft.com/dotnet/samples@sha256:410cc283c517e988815a8c0667a78170b4b19d61090c0a980bca3cdda00bceae' (DryRun=True, CopyReferrers=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Importing platform linux/arm64/v8 for multi-platform image [dotnetapp-10.0,dotnetapp,latest].
13:02:24 info: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] mcr.microsoft.com/dotnet/samples@sha256:b5254d7edfc5bec50f80dd30280c8b25437e3fc0fda0af3038247fa44ba4051d has 0 referrer(s) (DryRun=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.CopyImageService[0] Importing 'mcr.microsoft.com.azurecr.io/dotnet/samples:dotnetapp-10.0-alpine-arm64v8' and 0 referrer(s) from 'mcr.microsoft.com/dotnet/samples@sha256:b5254d7edfc5bec50f80dd30280c8b25437e3fc0fda0af3038247fa44ba4051d' (DryRun=True, CopyReferrers=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Importing platform linux/amd64 for multi-platform image [aspnetapp-10.0,aspnetapp].
13:02:24 info: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] mcr.microsoft.com/dotnet/samples@sha256:72d3cf8495b5d42cdbb3cc3246585dff7b4f832d69689e7fa4dd8c193f5f776e has 0 referrer(s) (DryRun=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.CopyImageService[0] Importing 'mcr.microsoft.com.azurecr.io/dotnet/samples:aspnetapp-10.0-alpine-amd64' and 0 referrer(s) from 'mcr.microsoft.com/dotnet/samples@sha256:72d3cf8495b5d42cdbb3cc3246585dff7b4f832d69689e7fa4dd8c193f5f776e' (DryRun=True, CopyReferrers=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Importing platform linux/arm/v7 for multi-platform image [aspnetapp-10.0,aspnetapp].
13:02:24 info: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] mcr.microsoft.com/dotnet/samples@sha256:768afdbe228b285ae163ace0e40c6b8498ac14473436bcd750f08134d39f1526 has 0 referrer(s) (DryRun=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.CopyImageService[0] Importing 'mcr.microsoft.com.azurecr.io/dotnet/samples:aspnetapp-10.0-alpine-arm32v7' and 0 referrer(s) from 'mcr.microsoft.com/dotnet/samples@sha256:768afdbe228b285ae163ace0e40c6b8498ac14473436bcd750f08134d39f1526' (DryRun=True, CopyReferrers=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] Importing platform linux/arm64/v8 for multi-platform image [aspnetapp-10.0,aspnetapp].
13:02:24 info: Microsoft.DotNet.ImageBuilder.Oras.OrasDotNetService[0] mcr.microsoft.com/dotnet/samples@sha256:b1f8f81c5f6350b120dd41c821a8aa3eae061a25ff7111fd300552b6318496f5 has 0 referrer(s) (DryRun=True)
13:02:24 dbug: Microsoft.DotNet.ImageBuilder.CopyImageService[0] Importing 'mcr.microsoft.com.azurecr.io/dotnet/samples:aspnetapp-10.0-alpine-arm64v8' and 0 referrer(s) from 'mcr.microsoft.com/dotnet/samples@sha256:b1f8f81c5f6350b120dd41c821a8aa3eae061a25ff7111fd300552b6318496f5' (DryRun=True, CopyReferrers=True)
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest create --amend mcr.microsoft.com/dotnet/samples:dotnetapp-10.0 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-amd64 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm32v7 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm64v8 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-nanoserver-ltsc2022
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest create --amend mcr.microsoft.com/dotnet/samples:dotnetapp mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-amd64 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm32v7 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm64v8 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-nanoserver-ltsc2022
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest create --amend mcr.microsoft.com/dotnet/samples:latest mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-amd64 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm32v7 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-alpine-arm64v8 mcr.microsoft.com/dotnet/samples:dotnetapp-10.0-nanoserver-ltsc2022
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest create --amend mcr.microsoft.com/dotnet/samples:aspnetapp-10.0 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-amd64 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm32v7 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm64v8 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-nanoserver-ltsc2022
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest create --amend mcr.microsoft.com/dotnet/samples:aspnetapp mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-amd64 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm32v7 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-alpine-arm64v8 mcr.microsoft.com/dotnet/samples:aspnetapp-10.0-nanoserver-ltsc2022
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest push mcr.microsoft.com/dotnet/samples:latest
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest push mcr.microsoft.com/dotnet/samples:aspnetapp-10.0
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest push mcr.microsoft.com/dotnet/samples:aspnetapp
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest push mcr.microsoft.com/dotnet/samples:dotnetapp
13:02:24 info: ExecuteHelper[0] EXECUTING [DRY RUN]: docker manifest push mcr.microsoft.com/dotnet/samples:dotnetapp-10.0
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] mcr.microsoft.com/dotnet/samples:dotnetapp-10.0
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] mcr.microsoft.com/dotnet/samples:dotnetapp
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] mcr.microsoft.com/dotnet/samples:latest
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] mcr.microsoft.com/dotnet/samples:aspnetapp-10.0
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] mcr.microsoft.com/dotnet/samples:aspnetapp
13:02:24 info: Microsoft.DotNet.ImageBuilder.Commands.CreateManifestListCommand[0] SETTING TAG INFO

@lbussell
lbussell merged commit 47ba677 into dotnet:main May 28, 2026
12 checks passed
@lbussell
lbussell deleted the issue-2107 branch May 28, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path-filtered builds can overwrite shared tags with partial manifest lists

2 participants