MCPcopy
hub / github.com/dgraph-io/dgraph / DockerExec

Function DockerExec

testutil/docker.go:290–299  ·  view source on GitHub ↗

DockerExec executes a command inside the given container.

(instance string, cmd ...string)

Source from the content-addressed store, hash-verified

288
289// DockerExec executes a command inside the given container.
290func DockerExec(instance string, cmd ...string) error {
291 c := getContainer(instance)
292 if c.ID == "" {
293 glog.Fatalf("Unable to find container: %s\n", instance)
294 return nil
295 }
296 argv := []string{"docker", "exec", "--user", "root", c.ID}
297 argv = append(argv, cmd...)
298 return Exec(argv...)
299}
300
301func DockerInspect(containerID string) (container.InspectResponse, error) {
302 cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())

Callers 3

DirSetupFunction · 0.92
DirCleanupFunction · 0.92
dirCleanupFunction · 0.92

Calls 3

getContainerFunction · 0.85
ExecFunction · 0.85
FatalfMethod · 0.80

Tested by 1

dirCleanupFunction · 0.74