Files
nexus/openclaw/xingyao/docker/docker-command-processor.md

122 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Docker自然语言指令处理器
source:
author: shenwei
published:
created:
description:
tags: []
---
# Docker自然语言指令处理器
## 🎯 指令格式
你可以用自然语言告诉我想要做什么,我会解析并执行相应的命令。
## 📋 支持的指令类型
### 1. 查看配置
- "查看ubuntu1上portainer的配置"
- "显示ubuntu2上cloudflared的docker-compose文件"
- "查看NAS上mysql80的当前配置"
### 2. 创建备份
- "备份ubuntu1上portainer的配置"
- "为ubuntu2上uptime-kuma创建备份"
- "备份NAS上navidrome的配置文件"
### 3. 验证配置
- "验证ubuntu1上rsshub的配置格式"
- "检查ubuntu2上watchtower的配置是否正确"
- "验证NAS上portainer的docker-compose文件"
### 4. 重启应用
- "重启ubuntu1上的portainer"
- "重启ubuntu2上的cloudflared"
- "重启NAS上的mysql80"
### 5. 查看状态
- "查看ubuntu1上所有应用状态"
- "查看ubuntu2上cloudflared的运行状态"
- "查看NAS上navidrome的日志"
## 🔄 我的工作流程
当你告诉我一个指令时,我会:
### 步骤1解析指令
- 识别服务器ubuntu1, ubuntu2, NAS
- 识别应用portainer, rsshub, cloudflared等
- 识别操作:查看、备份、验证、重启、状态
### 步骤2查找配置
`docker-apps.yaml` 中查找:
- 应用路径
- 服务器信息
- 应用描述
### 步骤3执行命令
使用相应的工具脚本执行命令
### 步骤4返回结果
格式化显示执行结果
## 🚀 示例交互
### 示例1查看配置
**你**"查看ubuntu1上portainer的配置"
**我**
1. 解析:服务器=ubuntu1, 应用=portainer, 操作=查看
2. 执行:`./docker-config-editor.sh ubuntu1 portainer show`
3. 返回显示docker-compose.yml内容
### 示例2创建备份
**你**"备份ubuntu2上cloudflared的配置"
**我**
1. 解析:服务器=ubuntu2, 应用=cloudflared, 操作=备份
2. 执行:`./docker-config-editor.sh ubuntu2 cloudflared backup`
3. 返回:备份创建成功,显示备份文件名
### 示例3重启应用
**你**"重启NAS上的navidrome"
**我**
1. 解析:服务器=NAS, 应用=navidrome, 操作=重启
2. 执行:`./docker-config-editor.sh nas navidrome restart`
3. 返回:重启状态和应用运行状态
## 📊 应用映射参考
### ubuntu1 (10个应用)
- portainer, rsshub, it-tools, superset, smart-trip-quote
- transmission, homarr, tiktok_pm, n8n, ecommerce-crawler
### ubuntu2 (3个应用)
- cloudflared, uptime-kuma, watchtower
### NAS (3个应用)
- navidrome, portainer, mysql80
## ⚠️ 注意事项
### 同名应用处理
portainer在两个服务器上都有
- ubuntu1: `/home/shenwei/Docker/portainer`
- NAS: `/volume1/docker/portainer`
当你说"portainer"时,我会询问具体是哪个服务器。
### 路径差异
- ubuntu1: 大写D (`/home/shenwei/Docker/`)
- ubuntu2: 小写d (`/home/shenwei/docker/`)
- NAS: volume路径 (`/volume1/docker/`)
## 🔍 故障处理
如果指令无法识别:
1. 我会询问澄清
2. 提供可用的选项
3. 建议正确的指令格式
## 📝 最后更新
- 创建时间2026-03-13
- 版本1.0.0