MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / PrintDockerComposeContainers

Function PrintDockerComposeContainers

cli/cmd/start/env.go:150–161  ·  view source on GitHub ↗

打印 service 列表

(dockerComposeContainers []DockerComposeContainer)

Source from the content-addressed store, hash-verified

148
149// 打印 service 列表
150func PrintDockerComposeContainers(dockerComposeContainers []DockerComposeContainer) {
151 if len(dockerComposeContainers) <= 0 {
152 return
153 }
154 w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0)
155 fmt.Fprintln(w, i18nInstance.Common.Info_table_header_containers)
156 for _, service := range dockerComposeContainers {
157 line := fmt.Sprintf("%v\t%v\t%v\t%v\t", service.ServiceName, service.State, service.Image, strings.Join(service.Ports, "; "))
158 fmt.Fprintln(w, line)
159 }
160 w.Flush()
161}

Callers 1

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected