MCPcopy
hub / github.com/kagent-dev/kagent / Run

Method Run

go/core/cli/internal/common/exec/docker.go:54–70  ·  view source on GitHub ↗

Run executes a docker command with the given arguments. It automatically handles verbose logging and working directory configuration.

(args ...string)

Source from the content-addressed store, hash-verified

52// Run executes a docker command with the given arguments.
53// It automatically handles verbose logging and working directory configuration.
54func (d *DockerExecutor) Run(args ...string) error {
55 if d.Verbose {
56 fmt.Printf("Running: docker %s\n", strings.Join(args, " "))
57 if d.WorkDir != "" {
58 fmt.Printf("Working directory: %s\n", d.WorkDir)
59 }
60 }
61
62 cmd := exec.Command("docker", args...)
63 if d.WorkDir != "" {
64 cmd.Dir = d.WorkDir
65 }
66 cmd.Stdout = os.Stdout
67 cmd.Stderr = os.Stderr
68
69 return cmd.Run()
70}
71
72// Build builds a Docker image with the specified name and context.
73// Additional build arguments can be provided (e.g., "--platform", "linux/amd64").

Calls 1

JoinMethod · 0.45