MCPcopy Index your code
hub / github.com/docker/cli / runInspect

Function runInspect

cli/command/image/inspect.go:59–81  ·  view source on GitHub ↗
(ctx context.Context, dockerCLI command.Cli, opts inspectOptions)

Source from the content-addressed store, hash-verified

57}
58
59func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {
60 var platform *ocispec.Platform
61 if opts.platform != "" {
62 p, err := platforms.Parse(opts.platform)
63 if err != nil {
64 return err
65 }
66 platform = &p
67 }
68
69 apiClient := dockerCLI.Client()
70 return inspect.Inspect(dockerCLI.Out(), opts.refs, opts.format, func(ref string) (any, []byte, error) {
71 var buf bytes.Buffer
72 resp, err := apiClient.ImageInspect(ctx, ref,
73 client.ImageInspectWithRawResponse(&buf),
74 client.ImageInspectWithPlatform(platform),
75 )
76 if err != nil {
77 return image.InspectResponse{}, nil, err
78 }
79 return resp, buf.Bytes(), err
80 })
81}

Callers 1

newInspectCommandFunction · 0.70

Calls 4

ClientMethod · 0.65
InspectMethod · 0.65
OutMethod · 0.65
ImageInspectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…