MCPcopy Index your code
hub / github.com/kagent-dev/kagent / Build

Method Build

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

Build builds a Docker image with the specified name and context. Additional build arguments can be provided (e.g., "--platform", "linux/amd64").

(imageName, context string, extraArgs ...string)

Source from the content-addressed store, hash-verified

72// Build builds a Docker image with the specified name and context.
73// Additional build arguments can be provided (e.g., "--platform", "linux/amd64").
74func (d *DockerExecutor) Build(imageName, context string, extraArgs ...string) error {
75 args := []string{"build", "-t", imageName}
76 args = append(args, extraArgs...)
77 args = append(args, context)
78
79 if err := d.Run(args...); err != nil {
80 return fmt.Errorf("docker build failed: %w", err)
81 }
82
83 fmt.Printf("✅ Successfully built Docker image: %s\n", imageName)
84 return nil
85}
86
87// Push pushes a Docker image to a registry.
88func (d *DockerExecutor) Push(imageName string) error {

Callers 4

BuildCmdFunction · 0.95
buildMcpServerImagesFunction · 0.95
buildDockerImageMethod · 0.95
BuildMcpFunction · 0.45

Calls 1

RunMethod · 0.95

Tested by

no test coverage detected