{"record":{"id":"f6fe23ec20005ca4","repo":"docker/cli","slug":"manifest-for-image-s-does-not-exist-in-s","errorCode":null,"errorMessage":"manifest for image %s does not exist in %s","messagePattern":"manifest for image (.+?) does not exist in (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/manifest/annotate.go","lineNumber":139,"sourceCode":"\n\treturn cmd\n}\n\nfunc runManifestAnnotate(dockerCLI command.Cli, opts annotateOptions) error {\n\ttargetRef, err := normalizeReference(opts.target)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"annotate: error parsing name for manifest list %s: %w\", opts.target, err)\n\t}\n\timgRef, err := normalizeReference(opts.image)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"annotate: error parsing name for manifest %s: %w\", opts.image, err)\n\t}\n\n\tmanifestStore := newManifestStore(dockerCLI)\n\timageManifest, err := manifestStore.Get(targetRef, imgRef)\n\tswitch {\n\tcase errdefs.IsNotFound(err):\n\t\treturn fmt.Errorf(\"manifest for image %s does not exist in %s\", opts.image, opts.target)\n\tcase err != nil:\n\t\treturn err\n\t}\n\n\t// Update the mf\n\tif imageManifest.Descriptor.Platform == nil {\n\t\timageManifest.Descriptor.Platform = new(ocispec.Platform)\n\t}\n\tif opts.os != \"\" {\n\t\timageManifest.Descriptor.Platform.OS = opts.os\n\t}\n\tif opts.arch != \"\" {\n\t\timageManifest.Descriptor.Platform.Architecture = opts.arch\n\t}\n\tfor _, osFeature := range opts.osFeatures {\n\t\timageManifest.Descriptor.Platform.OSFeatures = appendIfUnique(imageManifest.Descriptor.Platform.OSFeatures, osFeature)\n\t}\n\tif opts.variant != \"\" {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/manifest/annotate.go#L121-L157","documentation":"Returned by `runManifestAnnotate` (annotate.go:136-139) when the local manifest store's `Get(targetRef, imgRef)` returns an `errdefs.IsNotFound` error. This means the image has not been added to the local manifest list yet — annotation only works on entries previously created via `docker manifest create`.","triggerScenarios":"Running `docker manifest annotate list otherimage:tag --arch amd64` where `otherimage:tag` was never added to `list`, or where `list` itself was never created locally.","commonSituations":"Wrong order of operations (annotating before create), typo in either name, or the local manifest cache (~/.local/share/docker/manifests) was cleared.","solutions":["Create the list and add the image first: `docker manifest create <list> <image>`.","Re-check both names for typos against what was created.","List local manifests to confirm the entry exists before annotating.","Re-create the list if the local manifest store was purged."],"exampleFix":"# before\ndocker manifest annotate mylist otherimage:1.0 --arch amd64   # otherimage not in list\n# after\ndocker manifest create mylist otherimage:1.0\ndocker manifest annotate mylist otherimage:1.0 --arch amd64","handlingStrategy":"validation","validationCode":"// confirm the entry exists before annotating\nstore := newManifestStore(cli)\nif _, err := store.Get(targetRef, imgRef); errdefs.IsNotFound(err) {\n    return fmt.Errorf(\"nothing to annotate — run `docker manifest create %s %s` first\", targetRef, imgRef)\n}","typeGuard":null,"tryCatchPattern":"if err := runManifestAnnotate(cli, opts); err != nil {\n    if strings.Contains(err.Error(), \"does not exist in\") {\n        // guide the user to create first\n        return fmt.Errorf(\"%w — create the list/add the image first\", err)\n    }\n    return err\n}","preventionTips":["Always run `docker manifest create` before annotate.","Verify names match across create/annotate.","Don't purge local manifest cache between create and annotate."],"tags":["manifest","annotate","not-found","manifest-store","docker-cli"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}