build_image
Builds a container image from a local context path asynchronously and returns a build ID for polling status.
Instructions
Build an image from a local context path (runs asynchronously — builds can be long).
Returns a build_id to poll with check_build_status.
Args:
context_path: Path to the build context directory.
tag: Image name and tag, e.g. "myapp:v1".
secrets: Secret specs, e.g. ["id=mysecret,src=secret.txt"].
dockerfile: Path to a custom Dockerfile (default: Dockerfile in context_path).
build_args: Build-time variables, e.g. ["VERSION=1.0"].
no_cache: Disable layer cache.
platform: Target platform, e.g. "linux/amd64".
target: Multi-stage build target stage name.
ssh: Forward the host's SSH agent to the build (Apple Container 1.2.1+), e.g. "default".
Only reachable during a Dockerfile `RUN --mount=type=ssh` step, not for the container's
whole lifetime — unrelated to (and no more exposed than) `run_container`'s SSH handling,
which stays blocked.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"context_path": "<context_path>"
},
"name": "build_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ssh | No | ||
| tag | No | ||
| target | No | ||
| secrets | No | ||
| no_cache | No | ||
| platform | No | ||
| build_args | No | ||
| dockerfile | No | ||
| context_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |