MCPcopy
hub / github.com/docker/compose / labeledLocalImages

Method labeledLocalImages

pkg/compose/image_pruner.go:151–165  ·  view source on GitHub ↗

labeledLocalImages are images that were locally-built by a current version of Compose (it did not always label built images). The image name could either have been defined by the user or implicitly created from the project + service name.

(ctx context.Context)

Source from the content-addressed store, hash-verified

149// The image name could either have been defined by the user or implicitly
150// created from the project + service name.
151func (p *ImagePruner) labeledLocalImages(ctx context.Context) ([]image.Summary, error) {
152 res, err := p.client.ImageList(ctx, client.ImageListOptions{
153 // TODO(milas): we should really clean up the dangling images as
154 // well (historically we have NOT); need to refactor this to handle
155 // it gracefully without producing confusing CLI output, i.e. we
156 // do not want to print out a bunch of untagged/dangling image IDs,
157 // they should be grouped into a logical operation for the relevant
158 // service
159 Filters: projectFilter(p.project.Name).Add("dangling", "false"),
160 })
161 if err != nil {
162 return nil, err
163 }
164 return res.Items, nil
165}
166
167// unlabeledLocalImages are images that match the implicit naming convention
168// for locally-built images but did not get labeled, presumably because they

Callers 1

ImagesToPruneMethod · 0.95

Calls 3

projectFilterFunction · 0.85
ImageListMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected