docker/cli · error

manifest for image does not exist in

Error message

manifest for image %s does not exist in %s

What it means

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`.

Solutions

  1. Create the list and add the image first: `docker manifest create <list> <image>`.
  2. Re-check both names for typos against what was created.
  3. List local manifests to confirm the entry exists before annotating.
  4. Re-create the list if the local manifest store was purged.

Example fix

# before
docker manifest annotate mylist otherimage:1.0 --arch amd64   # otherimage not in list
# after
docker manifest create mylist otherimage:1.0
docker manifest annotate mylist otherimage:1.0 --arch amd64
Defensive patterns

Strategy: validation

Validate before calling

// confirm the entry exists before annotating
store := newManifestStore(cli)
if _, err := store.Get(targetRef, imgRef); errdefs.IsNotFound(err) {
    return fmt.Errorf("nothing to annotate — run `docker manifest create %s %s` first", targetRef, imgRef)
}

Try / catch

if err := runManifestAnnotate(cli, opts); err != nil {
    if strings.Contains(err.Error(), "does not exist in") {
        // guide the user to create first
        return fmt.Errorf("%w — create the list/add the image first", err)
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: Wrong order of operations (annotating before create), typo in either name, or the local manifest cache (~/.local/share/docker/manifests) was cleared.

Related errors


AI-assisted analysis of docker/cli@4f84911bfe (2026-08-07). Data as JSON: /api/errors/f6fe23ec20005ca4. Report an issue: GitHub.

Appendix: source

Thrown at cli/command/manifest/annotate.go:139

	return cmd
}

func runManifestAnnotate(dockerCLI command.Cli, opts annotateOptions) error {
	targetRef, err := normalizeReference(opts.target)
	if err != nil {
		return fmt.Errorf("annotate: error parsing name for manifest list %s: %w", opts.target, err)
	}
	imgRef, err := normalizeReference(opts.image)
	if err != nil {
		return fmt.Errorf("annotate: error parsing name for manifest %s: %w", opts.image, err)
	}

	manifestStore := newManifestStore(dockerCLI)
	imageManifest, err := manifestStore.Get(targetRef, imgRef)
	switch {
	case errdefs.IsNotFound(err):
		return fmt.Errorf("manifest for image %s does not exist in %s", opts.image, opts.target)
	case err != nil:
		return err
	}

	// Update the mf
	if imageManifest.Descriptor.Platform == nil {
		imageManifest.Descriptor.Platform = new(ocispec.Platform)
	}
	if opts.os != "" {
		imageManifest.Descriptor.Platform.OS = opts.os
	}
	if opts.arch != "" {
		imageManifest.Descriptor.Platform.Architecture = opts.arch
	}
	for _, osFeature := range opts.osFeatures {
		imageManifest.Descriptor.Platform.OSFeatures = appendIfUnique(imageManifest.Descriptor.Platform.OSFeatures, osFeature)
	}
	if opts.variant != "" {

View on GitHub (pinned to 4f84911bfe)