{"id":"84dd0627dbe570c2","repo":"docker/cli","slug":"cannot-use-source-images-from-a-different-registry","errorCode":null,"errorMessage":"cannot use source images from a different registry than the target image: %s != %s","messagePattern":"cannot use source images from a different registry than the target image: (.+?) != (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/manifest/push.go","lineNumber":147,"sourceCode":"\t\t\timageManifest.Descriptor.Platform.Architecture == \"\" ||\n\t\t\timageManifest.Descriptor.Platform.OS == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"manifest %s must have an OS and Architecture to be pushed to a registry\", imageManifest.Ref)\n\t\t}\n\t\tdescriptor, err := buildManifestDescriptor(targetRepo, imageManifest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdescriptors = append(descriptors, descriptor)\n\t}\n\n\treturn manifestlist.FromDescriptors(descriptors)\n}\n\nfunc buildManifestDescriptor(targetRepo reference.Named, imageManifest types.ImageManifest) (manifestlist.ManifestDescriptor, error) {\n\tmanifestRepoHostname := reference.Domain(reference.TrimNamed(imageManifest.Ref))\n\ttargetRepoHostname := reference.Domain(reference.TrimNamed(targetRepo))\n\tif manifestRepoHostname != targetRepoHostname {\n\t\treturn manifestlist.ManifestDescriptor{}, fmt.Errorf(\"cannot use source images from a different registry than the target image: %s != %s\", manifestRepoHostname, targetRepoHostname)\n\t}\n\n\tmanifest := manifestlist.ManifestDescriptor{\n\t\tDescriptor: distribution.Descriptor{\n\t\t\tDigest:    imageManifest.Descriptor.Digest,\n\t\t\tSize:      imageManifest.Descriptor.Size,\n\t\t\tMediaType: imageManifest.Descriptor.MediaType,\n\t\t},\n\t}\n\n\tplatform := types.PlatformSpecFromOCI(imageManifest.Descriptor.Platform)\n\tif platform != nil {\n\t\tmanifest.Platform = *platform\n\t}\n\n\tif err := manifest.Descriptor.Digest.Validate(); err != nil {\n\t\treturn manifestlist.ManifestDescriptor{}, fmt.Errorf(\"digest parse of image %q failed: %w\", imageManifest.Ref, err)\n\t}","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/manifest/push.go#L129-L165","documentation":"Error \"cannot use source images from a different registry than the target image: %s != %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/manifest/push.go:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}