Skip to content

API Reference parrot_tools.docker.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.docker.models

View source

Docker data models for container, image, and compose operations.

Defines all Pydantic models used by the Docker Toolkit (FEAT-033). These models provide structured input/output for Docker CLI operations.

Class ComposeGenerateInput

Input for generating a docker-compose file.

Fields:

Field Type Default Description
project_name str Project name for the compose stack
services Dict[str, ComposeServiceDef] Service definitions keyed by service name
output_path str './docker-compose.yml' Path to write the generated file

Class ComposeServiceDef

Definition of a single service in a docker-compose file.

Fields:

Field Type Default Description
image str Docker image
ports List[str] Port mappings (e.g., '8080:80')
volumes List[str] Volume mappings
environment Dict[str, str] Environment variables
depends_on List[str] Service dependencies
restart str 'unless-stopped' Restart policy
command Optional[str] Override command
healthcheck Optional[Dict[str, Any]] Health check config

Class ContainerInfo

Information about a Docker container.

Fields:

Field Type Default Description
container_id str Container ID
name str Container name
image str Image name
status str Container status
ports str '' Port mappings
created str '' Creation timestamp

Class ContainerRunInput

Input for docker_run operation.

Fields:

Field Type Default Description
image str Docker image to run
name Optional[str] Container name
ports List[PortMapping] Port mappings
volumes List[VolumeMapping] Volume mappings
env_vars Dict[str, str] Environment variables
command Optional[str] Override command
detach bool True Run in background
restart_policy Optional[str] None Restart policy (no, always, on-failure, unless-stopped)
cpu_limit Optional[str] CPU limit (e.g., '2' for 2 CPUs, '0.5' for half)
memory_limit Optional[str] Memory limit (e.g., '4g', '512m')

Class DockerBuildInput

Input for docker_build operation.

Fields:

Field Type Default Description
dockerfile_path str '.' Path to directory containing Dockerfile
tag str Image tag (e.g., 'myapp:latest')
build_args Dict[str, str] Build arguments
no_cache bool False Build without cache

Class DockerExecInput

Input for docker_exec operation.

Fields:

Field Type Default Description
container str Container name or ID
command str Command to execute
workdir Optional[str] Working directory inside container
env_vars Dict[str, str] Additional environment variables
user Optional[str] User to run command as

Class DockerOperationResult

Result of a Docker operation.

Fields:

Field Type Default Description
success bool Whether the operation succeeded
operation str Name of the operation performed
output str '' Raw output from the operation
containers List[ContainerInfo] Container info list
images List[ImageInfo] Image info list
error Optional[str] Error message if failed

Class ImageInfo

Information about a Docker image.

Fields:

Field Type Default Description
image_id str Image ID
repository str Repository name
tag str 'latest' Image tag
size str '' Image size
created str '' Creation timestamp

Class PortMapping

Port mapping for a container.

Accepts either structured dicts or Docker-style strings:

  • "11211:11211" → host=11211, container=11211, tcp
  • "8080:80/udp" → host=8080, container=80, udp
  • "443" → host=443, container=443, tcp

Fields:

Field Type Default Description
host_port int Host port
container_port int Container port
protocol str 'tcp' Protocol (tcp/udp)

Class PruneResult

Result of a Docker prune operation.

Fields:

Field Type Default Description
success bool Whether the prune succeeded
containers_removed int 0 Number of containers removed
images_removed int 0 Number of images removed
volumes_removed int 0 Number of volumes removed
space_reclaimed str '' Amount of disk space reclaimed
error Optional[str] Error message if failed

Class VolumeMapping

Volume mapping for a container.

Fields:

Field Type Default Description
host_path str Host path or volume name
container_path str Container mount path
read_only bool False Mount as read-only

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally