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

Function NewContainerContext

cli/command/formatter/container.go:107–128  ·  view source on GitHub ↗

NewContainerContext creates a new context for rendering containers

()

Source from the content-addressed store, hash-verified

105
106// NewContainerContext creates a new context for rendering containers
107func NewContainerContext() *ContainerContext {
108 containerCtx := ContainerContext{}
109 containerCtx.Header = SubHeaderContext{
110 "ID": ContainerIDHeader,
111 "Names": namesHeader,
112 "Image": ImageHeader,
113 "Command": commandHeader,
114 "CreatedAt": CreatedAtHeader,
115 "RunningFor": runningForHeader,
116 "Ports": PortsHeader,
117 "State": StateHeader,
118 "Status": StatusHeader,
119 "Size": SizeHeader,
120 "Labels": LabelsHeader,
121 "Mounts": mountsHeader,
122 "LocalVolumes": localVolumes,
123 "Networks": networksHeader,
124 "Platform": platformHeader,
125 "HealthStatus": healthStatusHeader,
126 }
127 return &containerCtx
128}
129
130// MarshalJSON makes ContainerContext implement json.Marshaler
131func (c *ContainerContext) MarshalJSON() ([]byte, error) {

Callers 2

verboseWriteTableMethod · 0.85
ContainerWriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…