MCPcopy Create free account
hub / github.com/docker/cli / buildManifestList

Function buildManifestList

cli/command/manifest/push.go:124–141  ·  view source on GitHub ↗
(manifests []types.ImageManifest, targetRef reference.Named)

Source from the content-addressed store, hash-verified

122}
123
124func buildManifestList(manifests []types.ImageManifest, targetRef reference.Named) (*manifestlist.DeserializedManifestList, error) {
125 targetRepo := reference.TrimNamed(targetRef)
126 descriptors := make([]manifestlist.ManifestDescriptor, 0, len(manifests))
127 for _, imageManifest := range manifests {
128 if imageManifest.Descriptor.Platform == nil ||
129 imageManifest.Descriptor.Platform.Architecture == "" ||
130 imageManifest.Descriptor.Platform.OS == "" {
131 return nil, fmt.Errorf("manifest %s must have an OS and Architecture to be pushed to a registry", imageManifest.Ref)
132 }
133 descriptor, err := buildManifestDescriptor(targetRepo, imageManifest)
134 if err != nil {
135 return nil, err
136 }
137 descriptors = append(descriptors, descriptor)
138 }
139
140 return manifestlist.FromDescriptors(descriptors)
141}
142
143func buildManifestDescriptor(targetRepo reference.Named, imageManifest types.ImageManifest) (manifestlist.ManifestDescriptor, error) {
144 manifestRepoHostname := reference.Domain(reference.TrimNamed(imageManifest.Ref))

Callers 1

buildPushRequestFunction · 0.85

Calls 1

buildManifestDescriptorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…