Docker & Compose 管理器:通过 Openclaw Skills 控制容器
作者:互联网
2026-03-30
什么是 OpenClaw Docker 插件?
OpenClaw Docker 插件是 AI 智能体与容器化基础设施之间的强大桥梁。作为 Openclaw Skills 的核心技能之一,它提供了一套完整的工具集,通过本地 Unix 套接字或支持全 TLS 的远程 TCP 连接与 Docker 引擎进行交互。该插件使开发人员能够在不离开 AI 驱动工作流的情况下,实现容器生命周期自动化并管理多容器应用。
该技能以安全性为优先设计,提供细粒度的权限和安全控制。通过与 Docker CLI 直接集成,它支持高级编排能力,包括对预定义项目的 Docker Compose 支持。无论是排除日志故障还是部署新服务,此技能都能简化 Openclaw Skills 生态系统中的 DevOps 任务。
下载入口:https://github.com/openclaw/skills/tree/main/skills/homeofe/openclaw-docker
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install openclaw-docker
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 openclaw-docker。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
OpenClaw Docker 插件 应用场景
- 监控容器运行状况并列出各环境中的运行进程。
- 获取并分析容器日志,用于调试和事件响应。
- 通过启动、停止和重启命令管理服务生命周期。
- 使用 Docker Compose up 和 down 操作编排复杂堆栈。
- 检查容器配置和元数据以进行系统审计。
- 插件使用本地 Unix 套接字或远程 TCP 端点建立与 Docker 守护进程的安全连接。
- 它根据配置的 allowedOperations 和 readOnly 设置验证请求的操作,以确保符合安全合规性。
- 对于 Compose 特定任务,该技能将命令映射到 composeProjects 配置中定义的授权目录。
- AI 智能体执行 docker_ps 或 docker_compose_up 等特定工具与 Docker CLI 交互。
- 容器状态或日志输出等结果将在定义的 timeoutMs 窗口内返回给智能体。
OpenClaw Docker 插件 配置指南
确保已安装 Docker Engine 和 Docker CLI。然后,通过 npm 安装插件:
npm install @elvatis_com/openclaw-docker
在 Openclaw Skills 设置中配置本地套接字:
{
"plugins": {
"openclaw-docker": {
"socketPath": "/var/run/docker.sock",
"readOnly": false,
"allowedOperations": ["ps", "logs", "inspect", "start", "stop", "restart", "compose_up", "compose_down", "compose_ps"],
"composeProjects": [{ "name": "my-app", "path": "/opt/my-app" }],
"timeoutMs": 15000
}
}
}
OpenClaw Docker 插件 数据架构与分类体系
此技能与 Docker API 和文件系统交互,以管理容器状态和项目配置。数据组织如下:
| 组件 | 描述 |
|---|---|
| 容器操作 | 包括 ps, logs, inspect, start, stop 和 restart 功能。 |
| Compose 项目 | 授权用于编排命令的命名项目路径。 |
| 安全配置 | 定义 TLS 路径 (ca.pem, cert.pem, key.pem) 和只读标志。 |
| 工具映射 | 将 AI 命令映射到特定的 Docker CLI 和 API 调用。 |
name: openclaw-docker
description: "Manage Docker containers and Compose projects via OpenClaw tools"
@elvatis_com/openclaw-docker
OpenClaw plugin for Docker container operations and Docker Compose project control.
Features
- Docker daemon connection via unix socket or TCP
- Optional TLS for remote daemon access
- Read and write container tools
- Docker Compose integration via
docker composeCLI - Safety controls with
readOnlyandallowedOperations - Configurable command timeout
Prerequisites
- Docker Engine installed and running on the host
- Docker CLI (
dockercommand) available in PATH (required for Compose operations) - Access to the Docker socket (
/var/run/docker.sock) or a remote Docker daemon via TCP
Installation
npm install @elvatis_com/openclaw-docker
Security Notes
- Use
readOnly: trueif you only need observation (ps, logs, inspect). This limits the blast radius. - TLS keys: If using TCP with TLS, keep your PEM files protected. Only configure trusted certificate paths.
- Compose directories: The plugin runs
docker composecommands in whichever directories you configure ascomposeProjects. Only configure trusted project paths. - Least privilege: Run the plugin in an environment with minimal Docker permissions when possible.
Configuration
Local socket (default)
{
"plugins": {
"openclaw-docker": {
"socketPath": "/var/run/docker.sock",
"readOnly": false,
"allowedOperations": ["ps", "logs", "inspect", "start", "stop", "restart", "compose_up", "compose_down", "compose_ps"],
"composeProjects": [
{ "name": "aegis", "path": "/opt/aegis" }
],
"timeoutMs": 15000
}
}
}
Remote Docker daemon with TLS
{
"plugins": {
"openclaw-docker": {
"host": "10.0.0.20",
"port": 2376,
"tls": {
"caPath": "/etc/openclaw/docker/ca.pem",
"certPath": "/etc/openclaw/docker/cert.pem",
"keyPath": "/etc/openclaw/docker/key.pem",
"rejectUnauthorized": true
},
"readOnly": true,
"composeProjects": []
}
}
}
Available Tools
docker_psdocker_logsdocker_inspectdocker_startdocker_stopdocker_restartdocker_compose_updocker_compose_downdocker_compose_ps
Usage Examples
- "List all running containers"
- "Show the last 200 lines from api-gateway logs"
- "Inspect redis container"
- "Restart identity-service"
- "Bring aegis compose project up"
- "Show status of aegis compose services"
Safety and Permissions
readOnly: trueallows onlyps,logs,inspect, andcompose_psallowedOperationslimits which tools can be executed- Compose operations are limited to projects in
composeProjects - Commands use timeout protection via
timeoutMs
Development
npm install
npm run build
npm test
License
MIT
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
信号管道:自动化营销情报工具 - Openclaw Skills
技能收益追踪器:监控 Openclaw 技能并实现变现
AI 合规准备就绪度:评估与治理工具 - Openclaw Skills
FOSMVVM ServerRequest 测试生成器:自动化 API 测试 - Openclaw Skills
酒店搜索器:AI 赋能的住宿与位置情报 - Openclaw Skills
Dub 链接 API:程序化链接管理 - Openclaw Skills
IntercomSwap:P2P BTC 与 USDT 跨链兑换 - Openclaw Skills
spotplay:macOS 原生 Spotify 播放控制 - Openclaw Skills
DeepSeek OCR:AI驱动的图像文本识别 - Openclaw Skills
Web Navigator:自动化网页研究与浏览 - Openclaw Skills
AI精选
