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

Function newInspectCommand

cli/command/manifest/inspect.go:25–49  ·  view source on GitHub ↗

NewInspectCommand creates a new `docker manifest inspect` command

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

23
24// NewInspectCommand creates a new `docker manifest inspect` command
25func newInspectCommand(dockerCLI command.Cli) *cobra.Command {
26 var opts inspectOptions
27
28 cmd := &cobra.Command{
29 Use: "inspect [OPTIONS] [MANIFEST_LIST] MANIFEST",
30 Short: "Display an image manifest, or manifest list",
31 Args: cli.RequiresRangeArgs(1, 2),
32 RunE: func(cmd *cobra.Command, args []string) error {
33 switch len(args) {
34 case 1:
35 opts.ref = args[0]
36 case 2:
37 opts.list = args[0]
38 opts.ref = args[1]
39 }
40 return runInspect(cmd.Context(), dockerCLI, opts)
41 },
42 DisableFlagsInUseLine: true,
43 }
44
45 flags := cmd.Flags()
46 flags.BoolVar(&opts.insecure, "insecure", false, "Allow communication with an insecure registry")
47 flags.BoolVarP(&opts.verbose, "verbose", "v", false, "Output additional info including layers and platform")
48 return cmd
49}
50
51func runInspect(ctx context.Context, dockerCli command.Cli, opts inspectOptions) error {
52 namedRef, err := normalizeReference(opts.ref)

Calls 1

runInspectFunction · 0.70

Used in the wild real call sites across dependent graphs

searching dependent graphs…