DockerExec executes a command inside the given container.
(instance string, cmd ...string)
| 288 | |
| 289 | // DockerExec executes a command inside the given container. |
| 290 | func 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 | |
| 301 | func DockerInspect(containerID string) (container.InspectResponse, error) { |
| 302 | cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) |