← 返回 Skills 市场
lky115

deploy-docker-auto

作者 LKY115 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
102
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install deploy-docker-auto
功能描述
在任何创造性工作之前必须使用 - 创建功能、构建组件、添加新功能或修改行为。通过协作对话探索用户意图、需求和设计。
使用说明 (SKILL.md)

TPAIP 项目 Docker 自动化部署

Overview

本技能提供了一套标准化的自动化流程,用于将 TPAIP(技象人工智能平台)项目的代码构建为 Docker 镜像,并安全地部署到指定的远程 Linux 服务器上,最后验证服务健康状态。

When to Use

  • 开发完成,需要将新功能部署到测试或生产环境。
  • 修复线上 Bug 后,需要进行热更新部署。
  • 作为自动化 CI/CD 流水线中的部署环节。

When NOT to Use

  • 首次进行服务器环境初始化(如安装 Docker、配置网络)。请先使用服务器初始化技能。
  • 部署非 TPAIP 项目或其他技术栈(如纯静态网站)的项目。
  • 需要进行复杂的、包含数据库迁移或数据回滚的灰度发布时。本技能侧重于“一键替换”式部署。

The Process

Step 1: 准备部署配置与环境检查

  1. 确认部署信息:向用户确认或获取以下信息(不要自行编造):
    • 项目根目录路径:本地 TPAIP 项目代码的位置。
    • Dockerfile 路径:通常位于项目根目录,但需确认。
    • 镜像仓库地址:例如 registry.techphant.cn/tpaip/tpaip-server
    • 镜像标签:通常使用 Git 提交哈希或版本号,如 v1.2.3git-abc123
    • 目标服务器 SSH 连接信息:IP/域名、端口、用户名、密钥路径。
    • 服务器上的项目部署目录:例如 /opt/tpaip
    • 容器运行参数:需要映射的端口、环境变量文件(.env)路径、数据卷挂载点。
  2. 检查本地环境
    • 检查本地 Docker 服务是否运行:docker --version
    • 检查是否已登录到目标镜像仓库:docker info | grep Username
    • 如果检查失败:停下来告知用户具体问题(如 Docker 未启动),并提供解决建议或等待用户处理。

Step 2: 构建与推送 Docker 镜像

  1. 构建镜像
    • 进入项目根目录:cd \x3C项目根目录路径>
    • 执行构建命令:docker build -t \x3C镜像仓库地址>:\x3C镜像标签> -f \x3CDockerfile路径> .
    • 如果构建失败:分析 docker build 的输出日志,将错误信息(如依赖安装失败、编译错误)反馈给用户,并停止流程。
  2. 推送镜像
    • 执行推送命令:docker push \x3C镜像仓库地址>:\x3C镜像标签>
    • 如果推送失败:检查网络连接和仓库认证,提示用户重新登录或检查权限。

Step 3: 远程服务器部署

  1. 连接服务器并准备
    • 使用 SSH 连接到目标服务器。
    • 进入部署目录:cd \x3C服务器部署目录>
    • (可选)备份当前运行中的容器日志或配置文件。
  2. 拉取并运行新容器
    • 拉取新镜像:docker pull \x3C镜像仓库地址>:\x3C镜像标签>
    • 停止并移除旧容器(如果存在):docker stop tpaip-server && docker rm tpaip-server
    • 运行新容器。根据用户提供的参数组装命令,例如:
      docker run -d \
        --name tpaip-server \
        --restart unless-stopped \
        -p 8080:8080 \
        --env-file .env \
        -v ./data:/app/data \
        \x3C镜像仓库地址>:\x3C镜像标签>
      
    • 如果运行失败:检查 docker run 的错误信息(如端口冲突、环境变量文件缺失),报告给用户。

Step 4: 服务健康检查与验证

  1. 基础容器状态检查
    • 检查容器是否处于运行状态:docker ps | grep tpaip-server
    • 查看容器近期日志,排查启动错误:docker logs --tail 50 tpaip-server
  2. 应用层健康检查
    • 如果服务提供了健康检查接口(如 /health),使用 curl 调用该接口,验证返回状态码是否为 200 且内容包含 "status": "UP"
    • 如果健康检查失败:将详细的错误响应和日志摘要提供给用户,并询问是否回滚到上一个版本。

质量检查点

  • 在 Step 1 中,所有必要的部署配置(镜像标签、服务器信息等)均已明确获取,而非猜测。
  • 在 Step 2 中,docker builddocker push 命令执行成功,无错误输出。
  • 在 Step 3 中,新容器成功启动,且 docker ps 显示其状态为 Up
  • 在 Step 4 中,应用层健康检查接口返回成功响应(状态码200,内容健康)。
  • 部署后,通过浏览器或客户端能正常访问 TPAIP 服务的核心功能。
安全使用建议
This skill is coherent for its stated purpose, but it will need sensitive inputs to operate (SSH private key or credentials, registry login, and .env files). Before using it: (1) only provide a least-privilege deploy user and consider a dedicated deploy key or short-lived token; (2) avoid giving permanent access to your main account keys—use throwaway/rotated keys and rotate them after use; (3) run the process first in a staging environment and verify the exact commands the agent will execute; (4) keep backups and a rollback plan in case the new container fails; (5) if you are uncomfortable letting an agent access private keys directly, perform the SSH and key handling manually following the skill’s steps. If you want higher assurance, ask the skill author to document exactly how credentials are handled or to accept ephemeral tokens instead of raw key paths.
功能分析
Type: OpenClaw Skill Name: deploy-docker-auto Version: 1.0.0 The skill provides instructions for an AI agent to perform automated Docker deployments, which involves high-risk operations such as executing shell commands, managing SSH connections, and handling sensitive credentials (SSH keys and registry logins). While these actions are aligned with the stated purpose in SKILL.md, the construction of shell commands using user-provided variables (e.g., image tags and paths) poses a significant risk of shell injection. Per the analysis criteria, these risky capabilities are classified as suspicious even though they are plausibly needed for the deployment task.
能力评估
Purpose & Capability
Name/description (automatic Docker deployment for the TPAIP project) align with the instructions: building images, pushing to a registry, SSHing to a remote server, pulling and running containers, and performing health checks are expected for this purpose.
Instruction Scope
SKILL.md explicitly instructs the agent to ask for and use sensitive inputs (project path, Dockerfile path, registry address, image tag, SSH connection info including key path, server deploy directory, .env path). Those are appropriate for deployment but are sensitive; the instructions also assume the agent (or operator) will run local shell commands (docker build/push, curl) and SSH to the server. The skill does not attempt to access unrelated system paths or undeclared external endpoints.
Install Mechanism
Instruction-only skill with no install spec and no code to drop to disk. This is the lowest install risk — the skill will rely on existing docker/ssh tooling on the host.
Credentials
The skill does not declare required environment variables but reasonably requires credentials/inputs at runtime (SSH key, registry credentials, .env file). These are proportionate to a deploy workflow, but they are sensitive and the skill does not prescribe safe handling (e.g., using short-lived tokens or least-privilege deploy user).
Persistence & Privilege
Skill is not always-enabled and does not request persistent system privileges. Autonomous invocation is allowed by platform default (not a separate concern here) and the skill does not claim to modify other skills or global agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install deploy-docker-auto
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /deploy-docker-auto 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
deploy-docker-auto 1.0.1 - No functional or documentation changes detected in this version. - Version bump only; all skill content remains unchanged.
v1.0.0
- 首次发布 TPAIP 项目 Docker 自动化部署技能。 - 提供从本地构建、推送到远程服务器部署的完整标准化流程。 - 包含部署前环境检查、服务健康验证等关键步骤。 - 明确了适用场景(如功能上线、热更新)与不适用场景(如首次服务器初始化)。
元数据
Slug deploy-docker-auto
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

deploy-docker-auto 是什么?

在任何创造性工作之前必须使用 - 创建功能、构建组件、添加新功能或修改行为。通过协作对话探索用户意图、需求和设计。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 102 次。

如何安装 deploy-docker-auto?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install deploy-docker-auto」即可一键安装,无需额外配置。

deploy-docker-auto 是免费的吗?

是的,deploy-docker-auto 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

deploy-docker-auto 支持哪些平台?

deploy-docker-auto 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 deploy-docker-auto?

由 LKY115(@lky115)开发并维护,当前版本 v1.0.0。

💬 留言讨论