MCPcopy
hub / github.com/docker/compose / ContainerInspect

Method ContainerInspect

pkg/dryrun/dryrunclient.go:109–135  ·  view source on GitHub ↗
(ctx context.Context, container string, options client.ContainerInspectOptions)

Source from the content-addressed store, hash-verified

107}
108
109func (d *DryRunClient) ContainerInspect(ctx context.Context, container string, options client.ContainerInspectOptions) (client.ContainerInspectResult, error) {
110 containerJSON, err := d.apiClient.ContainerInspect(ctx, container, options)
111 if err != nil {
112 id := "dryRunId"
113 for _, c := range d.containers {
114 if c.ID == container {
115 id = container
116 }
117 }
118 return client.ContainerInspectResult{
119 Container: containerType.InspectResponse{
120 ID: id,
121 Name: container,
122 State: &containerType.State{
123 Status: containerType.StateRunning, // needed for --wait option
124 Health: &containerType.Health{
125 Status: containerType.Healthy, // needed for healthcheck control
126 },
127 },
128 Mounts: nil,
129 Config: &containerType.Config{},
130 NetworkSettings: &containerType.NetworkSettings{},
131 },
132 }, nil
133 }
134 return containerJSON, err
135}
136
137func (d *DryRunClient) ContainerKill(ctx context.Context, container string, options client.ContainerKillOptions) (client.ContainerKillResult, error) {
138 return client.ContainerKillResult{}, nil

Callers 15

LogsMethod · 0.45
logContainerMethod · 0.45
doAttachContainerMethod · 0.45
UpMethod · 0.45
StartMethod · 0.45
RemoveMethod · 0.45
createMobyContainerMethod · 0.45
isServiceHealthyMethod · 0.45
isServiceCompletedMethod · 0.45
PsMethod · 0.45
TestIsServiceHealthyFunction · 0.45

Calls

no outgoing calls

Tested by 6

TestIsServiceHealthyFunction · 0.36
TestCreateMobyContainerFunction · 0.36
TestPsFunction · 0.36