Skip to content

"could not find a matching digest value from the set of locally pulled digests" error when building locally #1981

@MichaelSimons

Description

@MichaelSimons

Repro:

Running on a Window 11 desktop in linux container mode.
Pull dotnet-docker repo
$ .\build-and-test.ps1 -Version 11.* -OS alpine3.23 -Mode Build

Results:

...
PULLING LATEST BASE IMAGES
--------------------------
-- EXECUTING: docker pull --platform linux/amd64 amd64/alpine:3.23
3.23: Pulling from amd64/alpine
Digest: sha256:da143300ea1b5cd2cf20cccafd3b4135047d232645974d28efa6a2314c9b1a11
Status: Image is up to date for amd64/alpine:3.23
docker.io/amd64/alpine:3.23
-- EXECUTION ELAPSED TIME: 00:00:00.7167725
-- EXECUTING: docker inspect docker.io/amd64/alpine:3.23 -f "{{ index .RepoDigests }}"
[amd64/alpine@sha256:da143300ea1b5cd2cf20cccafd3b4135047d232645974d28efa6a2314c9b1a11]
-- EXECUTION ELAPSED TIME: 00:00:00.0712058
Sending HTTP request: https://registry-1.docker.io/v2/amd64/alpine/manifests/3.23
Sending HTTP request: https://auth.docker.io/token?service=registry.docker.io&scope=repository:amd64/alpine:pull
Sending HTTP request: https://registry-1.docker.io/v2/amd64/alpine/manifests/3.23
Unhandled exception: System.InvalidOperationException: Found published digest 'sha256:da143300ea1b5cd2cf20cccafd3b4135047d232645974d28efa6a2314c9b1a11' for tag 'docker.io/amd64/alpine:3.23' but could not find a matching digest value from the set of locally pulled digests for this tag: amd64/alpine@sha256:da143300ea1b5cd2cf20cccafd3b4135047d232645974d28efa6a2314c9b1a11. This most likely means that this tag has been updated since it was last pulled.
   at Microsoft.DotNet.ImageBuilder.IManifestService.GetLocalImageDigestAsync(ImageName image, Boolean isDryRun) in /image-builder/ImageBuilder/IManifestService.cs:line 61
   at Microsoft.DotNet.ImageBuilder.LockHelper.<>c__DisplayClass3_0`2.<<DoubleCheckedLockLookupAsync>b__0>d.MoveNext() in /image-builder/ImageBuilder/LockHelper.cs:line 80
--- End of stack trace from previous location ---
   at Microsoft.DotNet.ImageBuilder.LockHelper.LockAsync(SemaphoreSlim semaphore, Func`1 func) in /image-builder/ImageBuilder/LockHelper.cs:line 99
   at Microsoft.DotNet.ImageBuilder.LockHelper.DoubleCheckedLockLookupAsync[TKey,TValue](SemaphoreSlim semaphore, IDictionary`2 dictionary, TKey key, Func`1 getValue, Func`2 addToDictionary) in /image-builder/ImageBuilder/LockHelper.cs:line 76
   at Microsoft.DotNet.ImageBuilder.Commands.BuildCommand.<PullBaseImagesAsync>b__39_2(String fromImage, CancellationToken cancellationToken) in /image-builder/ImageBuilder/Commands/BuildCommand.cs:line 695
   at System.Threading.Tasks.Parallel.<>c__53`1.<<ForEachAsync>b__53_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.DotNet.ImageBuilder.Commands.BuildCommand.PullBaseImagesAsync() in /image-builder/ImageBuilder/Commands/BuildCommand.cs:line 689
   at Microsoft.DotNet.ImageBuilder.RegistryCredentialsProviderExtensions.ExecuteWithCredentialsAsync(IRegistryCredentialsProvider credsProvider, Boolean isDryRun, Func`1 action, IRegistryCredentialsHost credentialsOptions, String registryName) in /image-builder/ImageBuilder/RegistryCredentialsProviderExtensions.cs:line 23
   at Microsoft.DotNet.ImageBuilder.Commands.BuildCommand.ExecuteWithDockerCredentialsAsync(Func`1 action) in /image-builder/ImageBuilder/Commands/BuildCommand.cs:line 127
   at Microsoft.DotNet.ImageBuilder.Commands.BuildCommand.ExecuteAsync() in /image-builder/ImageBuilder/Commands/BuildCommand.cs:line 108
   at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
Executing: 'docker container rm -f ImageBuilder-20260223103730'
ImageBuilder-20260223103730
Skipping samples builds since no input paths contained samples

@mthalman suggested this may be caused by the Docker Use containerd for pulling and storing images setting. I haven't been able to validate this.

Metadata

Metadata

Assignees

Type

Projects

Status

Sprint

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions