aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/inspect.go
blob: 4dd6b4a9a6c7c654fd51e1035a7024e0d370ba82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main

import (
	"github.com/containers/libpod/v2/cmd/podman/inspect"
	"github.com/containers/libpod/v2/cmd/podman/registry"
	"github.com/containers/libpod/v2/pkg/domain/entities"
	"github.com/spf13/cobra"
)

var (
	// Command: podman _inspect_ Object_ID
	inspectCmd = &cobra.Command{
		Use:   "inspect [flags] {CONTAINER_ID | IMAGE_ID}",
		Short: "Display the configuration of object denoted by ID",
		Long:  "Displays the low-level information on an object identified by name or ID",
		RunE:  inspectExec,
		Example: `podman inspect fedora
  podman inspect --type image fedora
  podman inspect CtrID ImgID
  podman inspect --format "imageId: {{.Id}} size: {{.Size}}" fedora`,
	}
	inspectOpts *entities.InspectOptions
)

func init() {
	registry.Commands = append(registry.Commands, registry.CliCommand{
		Mode:    []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
		Command: inspectCmd,
	})
	inspectOpts = inspect.AddInspectFlagSet(inspectCmd)
}

func inspectExec(cmd *cobra.Command, args []string) error {
	return inspect.Inspect(args, *inspectOpts)
}