Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

dockerfile-skilldockerfile 技能

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

724

周安装

29

GitHub Stars

24

下载量

234
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dockerfile-skill(dockerfile 技能)
来源仓库:https://github.com/labring/seakills
仓库路径:skills/dockerfile-skill
安装命令:
npx skills add https://github.com/labring/seakills --skill dockerfile-skill
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/labring/seakills --skill dockerfile-skill

简介

用于辅助云资源、部署、容器、基础设施和运维自动化任务,适合让 Agent 检查配置或整理部署步骤。

  • 适用于云资源管理、容器部署和运维自动化等场景。
  • 通过 npx skills add 命令从 seakills 仓库安装并使用该技能。
  • 使用时需明确目标环境、账号权限和资源组,区分本地测试与生产操作;涉及删除资源时应先确认影响范围。
  • 建议在测试环境中验证操作后再应用于生产。

SKILL.md

Dockerfile Generator Skill

Overview

This skill generates production-ready Dockerfiles through a 4-phase process:

  1. Deep Analysis - Understand project structure, workspace, migrations, and build complexity
  2. Generate - Create Dockerfile with migration handling and build optimization
  3. Build & Fix - Validate through actual build, fix errors iteratively
  4. Runtime Validation - Verify migrations ran, app works, database populated

Key Capabilities

  • Workspace/Monorepo Support: pnpm workspace, Turborepo, npm workspaces
  • Custom CLI Detection: Auto-detect custom build CLIs (turbo, nx, lerna, rush, or project-specific) and use correct syntax
  • Git Hash Bypass: Detect and handle projects requiring git commit hash (GITHUB_SHA)
  • Build-Time Env Vars: Auto-detect and add placeholders for Next.js SSG
  • Error Pattern Database: 40+ known error patterns with automatic fixes
  • Smart.dockerignore: Avoid excluding workspace-required files and CLI config dependencies
  • Custom Entry Points: Support for custom server launchers
  • Migration Detection: Auto-detect ORM, migrations, handle standalone mode
  • Build Optimization: Skip heavy CI tasks (lint/type-check) to prevent OOM
  • Runtime Validation: Verify migrations ran, database populated, app working
  • Native Module Support: Auto-detect Rust/NAPI-RS modules, multi-architecture builds
  • Static Asset Mapping: Detect backend's expected static paths and map frontend outputs
  • External Services: Auto-detect PostgreSQL, Redis, MinIO, ManticoreSearch dependencies
  • Zero Human Interaction: Auto-generate all config files including secrets

Usage

/dockerfile          # Analyze current directory
/dockerfile <github-url>    # Clone and analyze GitHub repo
/dockerfile <path>       # Analyze specific path

Quick Start

When invoked, ALWAYS follow this sequence:

  1. Read and execute modules/analyze.md
  2. Read and execute modules/generate.md
  3. Read and execute modules/build-fix.md

Workflow

Phase 1: Deep Project Analysis

Load and execute: modules/analyze.md

Output: Structured project metadata including:

  • Language / Framework / Package manager
  • Build commands / Run commands / Port
  • External dependencies (DB/Redis/S3)
  • System library requirements
  • Migration system detection (ORM, migration count, execution method)
  • Build complexity analysis (heavy operations, memory risk)
  • Complexity level (L1/L2/L3)

Phase 2: Generate Dockerfile

Load and execute: modules/generate.md

Input: Analysis result from Phase 1 Output:

  • Dockerfile (with migration handling, build optimization)
  • .dockerignore (workspace-aware)
  • docker-compose.yml (if external services needed)
  • .env.docker.local (auto-generated with test secrets)
  • docker-entrypoint.sh (with migration execution)
  • DOCKER.md (complete deployment guide)
  • Environment variable documentation

Key Enhancements:

  • Auto-detect Next.js Standalone + ORM → separate deps installation
  • Auto-detect heavy build operations → optimized build command
  • Auto-generate all config files → zero user input required

Phase 3: Build Validation (Closed Loop)

Load and execute: modules/build-fix.md

Process:

  1. Execute docker buildx build --platform linux/amd64 --load
  2. If success → Proceed to Phase 4
  3. If failure → Parse error, match pattern, fix Dockerfile, retry
  4. Max iterations based on complexity level

Phase 4: Runtime Validation

Critical Addition: Don't declare success until runtime verification passes!

Validation Steps:

  1. Container Startup: docker-compose up -d and verify no crashes
  2. Database Migration:
  • Query database: psql -c "\dt" → verify tables exist
  • Check migration count matches expected (e.g., 76/76)
  • Verify no "relation does not exist" errors
  1. Application Health:
  • Test HTTP endpoint → 200/302/401 acceptable, 500 is failure
  • Check logs for errors
  • Verify health check endpoint
  1. Success Criteria: Only declare success if ALL pass

Why This Matters:

  • Previous: Declared success after docker build, but app didn't work at runtime
  • Now: Verify migrations ran, database populated, app actually functional
  • Prevents silent migration failures (e.g., standalone mode missing ORM deps)

Supporting Resources

Complexity Levels

LevelCriteriaMax Build Iterations
L1Single language, no build step, no external services, no migrations1
L2Has build step, has external services (DB/Redis), simple migrations3
L3Monorepo, multi-language, complex dependencies, build-time env vars, complex migrations (76+)5

Common Issues & Solutions

1. Database migrations not running - MOST CRITICAL

Symptom: relation "users" does not exist at runtime Cause: Migrations detected but never executed Prevention: Analysis phase Step 12 detects migrations and configures execution Fix:

  • For Standalone + ORM: Install ORM deps separately
  • Add runtime migration to entrypoint script
  • Verify with psql -c "\dt" after container starts

2. Out of Memory during build

Symptom: Exit code 137, Killed, heap out of memory Cause: Build script includes lint/type-check for 39+ workspace packages Prevention: Analysis phase Step 13 detects heavy operations Fix: Skip CI tasks in Docker build, increase NODE_OPTIONS to 8192MB

3. Workspace files not found

Symptom: ENOENT: no such file or directory, open '/app/e2e/package.json' Cause:.dockerignore excludes workspace package.json files Fix: Use e2e/* instead of e2e, then !e2e/package.json

4. lockfile=false projects

Symptom: Cannot generate lockfile because lockfile is set to false Cause: Project has lockfile=false in.npmrc Fix: Use pnpm install instead of pnpm install --frozen-lockfile

5. Build-time env vars missing

Symptom: KEY_VAULTS_SECRET is not set Cause: Next.js SSG needs env vars at build time Fix: Add ARG/ENV placeholders in build stage

6. Node binary path

Symptom: spawn /bin/node ENOENT Cause: Scripts hardcode /bin/node but node:slim has it at /usr/local/bin/node Fix: Add RUN ln -sf /usr/local/bin/node /bin/node

7. ORM not found in Standalone mode

Symptom: Cannot find module 'drizzle-orm' at runtime Cause: Next.js standalone doesn't include all node_modules Prevention: Analysis phase detects standalone + ORM combination Fix: Install ORM separately in /deps and copy to final image

8. Wrong build command for monorepo with custom CLI

Symptom: Build succeeds but output files missing (e.g., assets-manifest.json not found) Cause: Using yarn workspace @scope/pkg build instead of detected custom CLI syntax Prevention: Analysis phase Step 14 detects custom CLI Fix: Use detected CLI syntax for all build commands

9. Git hash required but.git not in Docker context

Symptom: Failed to open git repo or nodegit errors Cause: Build tool requires git commit hash for versioning Prevention: Analysis phase Step 14 detects git hash dependency Fix: Set ENV GITHUB_SHA=docker-build to bypass git requirement

10. CLI config files excluded by.dockerignore

Symptom: CLI initialization (e.g., ${CLI_NAME} init) fails silently Cause: .prettierrc, .prettierignore, or other config files excluded Prevention: Analysis phase Step 14 detects config file dependencies Fix: Remove config files from.dockerignore exclusions

11. Static assets not found at runtime

Symptom: ENOENT: no such file or directory, open '/app/static/assets-manifest.json' Cause: Frontend builds to different path than backend expects Prevention: Analysis phase Step 14 detects static asset path mapping Fix: Copy frontend outputs to backend's expected path in Dockerfile

Success Criteria

A successful Dockerfile must:

Build Phase:

  1. Build without errors (docker buildx build exits 0)
  2. Image size reasonable (< 2GB for most apps)
  3. Follow production best practices (multi-stage, non-root, fixed versions)
  4. Include all necessary supporting files (.dockerignore, docker-compose.yml, etc.)
  5. Handle all workspace/monorepo requirements

Runtime Phase - CRITICAL: 6. Container starts successfully (no crashes) 7. Database migrations execute successfully (if migrations detected) 8. Database tables created (verify with psql) 9. Application responds with valid HTTP codes (200/302/401, not 500) 10. No runtime errors in logs (no "relation does not exist", etc.)

DO NOT declare success if:

  • Build passes but runtime fails
  • Migrations detected but tables missing
  • App returns 500 errors
  • Logs show database relation errors

Post-Build Validation COMPREHENSIVE

After successful build, perform FULL validation:

# 1. Start services
docker-compose up -d
sleep 30 # Wait for startup

# 2. Check container status
docker-compose ps
# Expected: All containers UP and HEALTHY

# 3. Verify database migrations
if [ migrations_detected ]; then
 # List tables
 docker-compose exec postgres psql -U <user> -d <db> -c "\dt"
 # Expected: List of tables (users, sessions, etc.)
 # If "Did not find any relations" → FAIL

 # Count migrations
 MIGRATION_COUNT=$(docker-compose exec postgres psql -U <user> -d <db> -t -c "SELECT COUNT(*) FROM <migration_table>;")
 # Expected: Matches analysis count (e.g., 76)
fi

# 4. Test application health
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3210)
# Expected: 200, 302, or 401
# Unacceptable: 500, 502, 503

if [ "$HTTP_CODE" = "500" ]; then
 echo "FAILURE: App returning 500 error"
 docker-compose logs app
 exit 1
fi

# 5. Check for errors in logs
docker-compose logs app | grep -i "error" | tail -20
# Should NOT contain:
# - "relation does not exist"
# - "table not found"
# - "Cannot find module"

# 6. Check image size
docker images <image-name>

# 7. Cleanup (if needed)
docker-compose down

Validation Checklist:

  • Image built successfully
  • Container started without crashes
  • Database connection established
  • Migrations executed (if applicable)
  • Database tables exist (if applicable)
  • HTTP endpoint returns valid status
  • No errors in application logs
  • Health check passes

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.28%
按下载量换算80

Claude

32.05%
按下载量换算75

Cursor

18.27%
按下载量换算43

Gemini CLI

8.67%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills