Docker
Manages Docker containers and images via the docker CLI. An agent can list and inspect containers/images, run new containers, start/stop/remove containers, exec commands inside them, tail logs, and pull images from a registry.
Add to an agent node's tools array with _node_type: "tool-docker". See Connector Reference — How connectors are used.
Authentication
| Field | Required | Description |
|---|---|---|
host | No | Docker host to target, e.g. tcp://host:2376 (passed as docker -H <host>). If omitted, the worker host's local Docker daemon (/var/run/docker.sock) is used. |
{
"name": "docker",
"_node_type": "tool-docker",
"host": "tcp://docker.internal:2376"
}
Tools
docker_list
List Docker containers with their status, ports and names.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
all | boolean | No | Include stopped containers |
Returns: A table (docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}", with -a if all is true).
docker_run
Run a Docker container from an image.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Docker image name e.g. nginx:latest |
name | string | No | Container name |
ports | string | No | Port mapping e.g. 8080:80 |
env | string | No | Environment vars e.g. KEY=val,OTHER=val2 |
command | string | No | Override container command |
detach | boolean | No | Run in background (default true). The container is run detached (-d) if detach is true or command is empty. |
Returns: The output of docker run (the new container ID when run detached).
docker_stop
Stop a running Docker container gracefully.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Container name or ID |
Returns: The output of docker stop <name>.
docker_start
Start a stopped Docker container.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Container name or ID |
Returns: The output of docker start <name>.
docker_logs
Get recent log output from a Docker container.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Container name or ID |
lines | number | No | Number of recent log lines (default 100) |
Returns: The output of docker logs --tail=<lines> <name>.
docker_exec
Execute a command inside a running Docker container.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Container name or ID |
command | string | Yes | Command to run |
Returns: The output of docker exec <name> sh -c "<command>".
docker_remove
Remove a stopped Docker container.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Container name or ID |
Returns: The output of docker rm <name>.
docker_images
List all Docker images on the host.
No parameters.
Returns: A table (docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedSince}}").
docker_pull
Pull a Docker image from a registry.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Image to pull e.g. nginx:latest |
Returns: The output of docker pull <image>.
docker_inspect
Inspect a Docker container or image — returns full JSON metadata.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Container or image name/ID |
Returns: The output of docker inspect <name>, pretty-printed as indented JSON if it parses successfully (otherwise the raw output).