For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
kagent build
kagent build command
Build a Docker image for an agent project.
kagent build [project-directory] [flags]Arguments:
project-directory- The directory containing the agent project withkagent.yaml
Flags:
--image- Full image specification (e.g., ghcr.io/myorg/my-agent:v1.0.0)--platform- Target platform for Docker build (e.g., linux/amd64, linux/arm64)--push- Push the image to the registry
Global Flags:
--kagent-url- kagent URL (default: “http://localhost:8083”)--namespace, -n- Namespace (default: “kagent”)--output-format, -o- Output format (default: “table”)--timeout- Timeout duration (default: 300s)--verbose, -v- Verbose output
About kagent build
The kagent build command builds Docker images for an agent project created with the init command. It looks for a kagent.yaml file in the specified project directory and builds Docker images using docker build.
Image naming:
- If
--imageis provided, it is used as the full image specification (e.g.,ghcr.io/myorg/my-agent:v1.0.0) - Otherwise, defaults to
localhost:5001/{agentName}:latestwhereagentNameis loaded fromkagent.yaml
Example
Build a Docker image:
kagent build ./my-agentBuild and tag a Docker image:
kagent build ./my-agent --image ghcr.io/myorg/my-agent:v1.0.0Build and push an image to a registry:
kagent build ./my-agent --image ghcr.io/myorg/my-agent:v1.0.0 --pushBuild for a specific platform:
kagent build ./my-agent --platform linux/amd64 --image ghcr.io/myorg/my-agent:v1.0.0