DockerTools enable an Agent to interact with Docker containers, images, volumes, and networks.
Prerequisites
The following example requires the docker and openai Python packages. You’ll also need Docker installed and running on your system.
Example
The following example creates an agent that can manage Docker resources:
cookbook/91_tools/docker_tools.py
DockerTools registers all functions by default, including remove_container, remove_image, remove_volume, remove_network, and exec_in_container, which runs an arbitrary command inside a container. There’s no allowlist or confirmation gate. Use include_tools/exclude_tools to scope access, and keep human supervision for untrusted prompts.
DockerTools registers all functions below by default. Limit them with the base toolkit params:
Container Management
Image Management
Volume Management
Network Management
Developer Resources