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

Function printManifest

cli/command/manifest/inspect.go:92–111  ·  view source on GitHub ↗
(dockerCli command.Cli, manifest types.ImageManifest, opts inspectOptions)

Source from the content-addressed store, hash-verified

90}
91
92func printManifest(dockerCli command.Cli, manifest types.ImageManifest, opts inspectOptions) error {
93 buffer := new(bytes.Buffer)
94 if !opts.verbose {
95 _, raw, err := manifest.Payload()
96 if err != nil {
97 return err
98 }
99 if err := json.Indent(buffer, raw, "", "\t"); err != nil {
100 return err
101 }
102 _, _ = fmt.Fprintln(dockerCli.Out(), buffer.String())
103 return nil
104 }
105 jsonBytes, err := json.MarshalIndent(manifest, "", "\t")
106 if err != nil {
107 return err
108 }
109 _, _ = dockerCli.Out().Write(append(jsonBytes, '\n'))
110 return nil
111}
112
113func printManifestList(dockerCli command.Cli, namedRef reference.Named, list []types.ImageManifest, opts inspectOptions) error {
114 if !opts.verbose {

Callers 1

runInspectFunction · 0.85

Calls 4

PayloadMethod · 0.80
OutMethod · 0.65
StringMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…