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

Function runHistory

cli/command/image/history.go:59–85  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, opts historyOptions)

Source from the content-addressed store, hash-verified

57}
58
59func runHistory(ctx context.Context, dockerCli command.Cli, opts historyOptions) error {
60 var options []client.ImageHistoryOption
61 if opts.platform != "" {
62 p, err := platforms.Parse(opts.platform)
63 if err != nil {
64 return fmt.Errorf("invalid platform: %w", err)
65 }
66 options = append(options, client.ImageHistoryWithPlatform(p))
67 }
68
69 history, err := dockerCli.Client().ImageHistory(ctx, opts.image, options...)
70 if err != nil {
71 return err
72 }
73
74 format := opts.format
75 if len(format) == 0 {
76 format = formatter.TableFormatKey
77 }
78
79 historyCtx := formatter.Context{
80 Output: dockerCli.Out(),
81 Format: newHistoryFormat(format, opts.quiet, opts.human),
82 Trunc: !opts.noTrunc,
83 }
84 return historyWrite(historyCtx, opts.human, history)
85}

Callers 1

newHistoryCommandFunction · 0.85

Calls 5

newHistoryFormatFunction · 0.85
historyWriteFunction · 0.85
ImageHistoryMethod · 0.80
ClientMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…