Skip to main content

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

FieldRequiredDescription
hostNoDocker 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

ParameterTypeRequiredDescription
allbooleanNoInclude 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

ParameterTypeRequiredDescription
imagestringYesDocker image name e.g. nginx:latest
namestringNoContainer name
portsstringNoPort mapping e.g. 8080:80
envstringNoEnvironment vars e.g. KEY=val,OTHER=val2
commandstringNoOverride container command
detachbooleanNoRun 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

ParameterTypeRequiredDescription
namestringYesContainer name or ID

Returns: The output of docker stop <name>.

docker_start

Start a stopped Docker container.

Parameters

ParameterTypeRequiredDescription
namestringYesContainer name or ID

Returns: The output of docker start <name>.

docker_logs

Get recent log output from a Docker container.

Parameters

ParameterTypeRequiredDescription
namestringYesContainer name or ID
linesnumberNoNumber 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

ParameterTypeRequiredDescription
namestringYesContainer name or ID
commandstringYesCommand to run

Returns: The output of docker exec <name> sh -c "<command>".

docker_remove

Remove a stopped Docker container.

Parameters

ParameterTypeRequiredDescription
namestringYesContainer 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

ParameterTypeRequiredDescription
imagestringYesImage 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

ParameterTypeRequiredDescription
namestringYesContainer or image name/ID

Returns: The output of docker inspect <name>, pretty-printed as indented JSON if it parses successfully (otherwise the raw output).

Next