Skip to content

Docker

Build, run, inspect, and manage Docker containers.

6 modules

ModuleDescription
Build Docker ImageBuild a Docker image from a Dockerfile
Inspect Docker ContainerGet detailed information about a Docker container
Get Container LogsGet logs from a Docker container
List Docker ContainersList Docker containers
Run Docker ContainerRun a Docker container from an image
Stop Docker ContainerStop a running Docker container

Modules

Build Docker Image

docker.build

Build a Docker image from a Dockerfile

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the build context directory
tagstringYes-Name and optionally tag the image (e.g. myapp:latest)
dockerfilestringNo-Path to the Dockerfile (relative to build context)
build_argsobjectNo-Build-time variables (e.g. {"NODE_ENV": "production"})
no_cachebooleanNoFalseDo not use cache when building the image

Output:

FieldTypeDescription
image_idstringID of the built image
tagstringTag applied to the image
sizestringSize of the built image

Example: Build from current directory

yaml
path: .
tag: myapp:latest

Example: Build with custom Dockerfile and args

yaml
path: ./backend
tag: myapi:v1.0
dockerfile: Dockerfile.prod
build_args: {"NODE_ENV": "production"}
no_cache: true

Inspect Docker Container

docker.inspect_container

Get detailed information about a Docker container

Parameters:

NameTypeRequiredDefaultDescription
containerstringYes-Container ID or name to inspect

Output:

FieldTypeDescription
idstringShort container ID
namestringContainer name
stateobjectContainer state (status, running, pid, exit_code, etc.)
imagestringImage used by the container
network_settingsobjectNetwork configuration (IP, ports, networks)
mountsarrayVolume and bind mounts
configobjectContainer configuration (env, cmd, labels, etc.)

Example: Inspect a container by name

yaml
container: my-nginx

Example: Inspect a container by ID

yaml
container: a1b2c3d4e5f6

Get Container Logs

docker.logs

Get logs from a Docker container

Parameters:

NameTypeRequiredDefaultDescription
containerstringYes-Container ID or name
tailnumberNo100Number of lines to show from the end of the logs
followbooleanNoFalseFollow log output (streams until timeout)
timestampsbooleanNoFalseShow timestamps in log output

Output:

FieldTypeDescription
logsstringContainer log output
linesnumberNumber of log lines returned

Example: Get last 50 lines

yaml
container: my-nginx
tail: 50

Example: Get logs with timestamps

yaml
container: my-app
tail: 100
timestamps: true

List Docker Containers

docker.ps

List Docker containers

Parameters:

NameTypeRequiredDefaultDescription
allbooleanNoFalseShow all containers (default shows just running)
filtersobjectNo-Filter containers (e.g. {"name": "my-app", "status": "running"})

Output:

FieldTypeDescription
containersarrayList of containers with id, name, image, status, ports
countnumberNumber of containers found

Example: List running containers

yaml

Example: List all containers

yaml
all: true

Example: Filter by name

yaml
filters: {"name": "nginx"}

Run Docker Container

docker.run

Run a Docker container from an image

Parameters:

NameTypeRequiredDefaultDescription
imagestringYes-Docker image to run (e.g. nginx:latest)
commandstringNo-Command to run inside the container
namestringNo-Assign a name to the container
portsobjectNo-Port mappings as host:container (e.g. {"8080": "80"})
volumesobjectNo-Volume mappings as host_path:container_path
envobjectNo-Environment variables to set in the container
detachbooleanNoTrueRun container in background
removebooleanNoFalseAutomatically remove the container when it exits
networkstringNo-Connect the container to a network

Output:

FieldTypeDescription
container_idstringID of the created container
statusstringContainer status after run

Example: Run Nginx web server

yaml
image: nginx:latest
name: my-nginx
ports: {"8080": "80"}
detach: true

Example: Run a one-off command

yaml
image: alpine:latest
command: echo hello world
remove: true
detach: false

Stop Docker Container

docker.stop

Stop a running Docker container

Parameters:

NameTypeRequiredDefaultDescription
containerstringYes-Container ID or name to stop
timeoutnumberNo10Seconds to wait before killing the container

Output:

FieldTypeDescription
container_idstringID or name of the stopped container
stoppedbooleanWhether the container was successfully stopped

Example: Stop a container by name

yaml
container: my-nginx

Example: Stop with custom timeout

yaml
container: my-app
timeout: 30

Released under the Apache 2.0 License.