MCPcopy Create free account
hub / github.com/containers/common / copyFromDockerArchiveReaderReference

Method copyFromDockerArchiveReaderReference

libimage/pull.go:323–344  ·  view source on GitHub ↗

copyFromDockerArchiveReaderReference copies the specified readerRef from reader.

(ctx context.Context, reader *dockerArchiveTransport.Reader, readerRef types.ImageReference, options *CopyOptions)

Source from the content-addressed store, hash-verified

321
322// copyFromDockerArchiveReaderReference copies the specified readerRef from reader.
323func (r *Runtime) copyFromDockerArchiveReaderReference(ctx context.Context, reader *dockerArchiveTransport.Reader, readerRef types.ImageReference, options *CopyOptions) ([]string, error) {
324 c, err := r.newCopier(options)
325 if err != nil {
326 return nil, err
327 }
328 defer c.close()
329
330 // Get a slice of storage references we can copy.
331 references, destNames, err := r.storageReferencesReferencesFromArchiveReader(ctx, readerRef, reader)
332 if err != nil {
333 return nil, err
334 }
335
336 // Now copy all of the images. Use readerRef for performance.
337 for _, destRef := range references {
338 if _, err := c.copy(ctx, readerRef, destRef); err != nil {
339 return nil, err
340 }
341 }
342
343 return destNames, nil
344}
345
346// copyFromRegistry pulls the specified, possibly unqualified, name from a
347// registry. On successful pull it returns the ID of the image in local

Callers 2

copyFromDockerArchiveMethod · 0.95

Calls 4

newCopierMethod · 0.95
closeMethod · 0.80
copyMethod · 0.80

Tested by

no test coverage detected