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

Method remove

libimage/image.go:347–350  ·  view source on GitHub ↗

remove removes the image along with all dangling parent images that no other image depends on. The image must not be set read-only and not be used by containers. Returns IDs of removed/untagged images in order. If the image is used by containers return storage.ErrImageUsedByContainer. Use force t

(ctx context.Context, rmMap map[string]*RemoveImageReport, referencedBy string, options *RemoveImagesOptions)

Source from the content-addressed store, hash-verified

345// This function is internal. Users of libimage should always use
346// `(*Runtime).RemoveImages()`.
347func (i *Image) remove(ctx context.Context, rmMap map[string]*RemoveImageReport, referencedBy string, options *RemoveImagesOptions) ([]string, error) {
348 processedIDs := []string{}
349 return i.removeRecursive(ctx, rmMap, processedIDs, referencedBy, options)
350}
351
352func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveImageReport, processedIDs []string, referencedBy string, options *RemoveImagesOptions) ([]string, error) {
353 // If referencedBy is empty, the image is considered to be removed via

Callers 1

RemoveImagesMethod · 0.80

Calls 1

removeRecursiveMethod · 0.95

Tested by

no test coverage detected