Token导航 LogoToken导航

Agent Skill · 研究检索

docker-configuration-validator(Docker configuration validator 搜索)

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

docker-configuration-validator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 8,219。

总安装 16,884周安装 447GitHub Stars 43下载 2,976核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rknall/claude-skills --skill 'Docker Configuration Validator'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于全面校验 Dockerfile 与 Compose 文件合规性与安全性。检查多阶段构建、镜像版本与 secrets 处理是否符合标准。输出审计结果与修复建议,支持 CI/CD 流水线集成。需用户提供待验证文件路径,避免处理敏感或临时配置。

docker-configuration-validator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/docker-configuration-validator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/rknall/claude-skills --skill 'Docker Configura…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

docker-configuration-validator 怎么安装?

在终端执行 npx skills add https://github.com/rknall/claude-skills --skill 'Docker Configuration Valid…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

docker-configuration-validator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

docker-configuration-validator 需要什么权限?

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

docker-configuration-validator 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

docker-configuration-validator 用的人多吗?

公开数据是累计安装 16,884 次,近一周安装 447 次,下载 2,976 次,GitHub 43 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

docker-configuration-validator 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
docker-configuration-validator

Docker configuration validator 搜索 · 本页

16,88443接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Docker Configuration Validator

This skill provides comprehensive validation for Dockerfiles and Docker Compose files, ensuring compliance with best practices, security standards, and modern syntax requirements.

When to Use This Skill

Activate this skill when the user requests:

  • Validate Dockerfiles or Docker Compose files
  • Review Docker configurations for best practices
  • Check for Docker security issues
  • Verify multi-stage build implementation
  • Audit Docker setup for production readiness
  • Ensure modern Docker Compose syntax compliance
  • Fix Docker configuration issues
  • Create validation scripts or CI/CD integration

Core Workflow

Phase 1: Initial Assessment

When a user requests Docker validation, start by understanding the scope:

  1. Identify What to Validate

- Single Dockerfile or multiple? - Docker Compose file(s)? - Entire project directory? - Specific concerns or focus areas? - Production vs development environment?

  1. Understand Requirements

- Security compliance level needed? - Multi-stage build requirement? - Performance constraints? - CI/CD integration needed? - Automated validation script desired?

  1. Check Available Tools

- Is Hadolint available? (Dockerfile linter) - Is DCLint available? (Docker Compose linter) - Is Docker CLI available? - Should tools be installed as part of process?

Phase 2: Dockerfile Validation

Step 1: Locate Dockerfiles

Find all Dockerfiles in the project:

find . -type f \( -name "Dockerfile*" ! -name "*.md" \)
Step 2: Run Hadolint Validation

If Hadolint is available:

# Validate each Dockerfile
hadolint Dockerfile

# JSON output for programmatic analysis
hadolint --format json Dockerfile

# Set failure threshold
hadolint --failure-threshold error Dockerfile

If Hadolint is NOT available:

  • Perform manual validation using built-in checks (see Step 3)
  • Recommend Hadolint installation
  • Provide installation instructions
Step 3: Manual Dockerfile Validation

Check each Dockerfile for critical issues:

1. Base Image Best Practices

  • ✅ Check: No :latest tags
  • ✅ Check: Specific version pinned
  • ✅ Check: Uses minimal base images (alpine/slim variants)
  • ✅ Check: Trusted registry used

2. Multi-Stage Build Verification

# Count FROM statements (should be >= 2 for multi-stage)
FROM_COUNT=$(grep -c "^FROM " Dockerfile)

# Check for named stages
NAMED_STAGES=$(grep -c "^FROM .* AS " Dockerfile)

# Check for inter-stage copies
COPY_FROM=$(grep -c "COPY --from=" Dockerfile)

Analysis:

  • If FROM_COUNT >= 2: Multi-stage build detected ✅
  • If COPY_FROM == 0 and FROM_COUNT >= 2: Warning - artifacts may not be transferred
  • If FROM_COUNT == 1: Single-stage build - recommend multi-stage for optimization

3. Security Checks

  • ✅ Check: USER directive present (non-root)
  • ✅ Check: Last USER is not root
  • ✅ Check: No secrets in Dockerfile
  • ✅ Check: WORKDIR uses absolute paths
  • ✅ Check: No unnecessary privileges

4. Layer Optimization

  • ✅ Check: Combined RUN commands
  • ✅ Check: Package manager cache cleaned
  • ✅ Check: COPY before RUN for better caching
  • ✅ Check:.dockerignore file exists

5. Best Practices

  • ✅ Check: HEALTHCHECK defined
  • ✅ Check: WORKDIR used (not cd)
  • ✅ Check: COPY preferred over ADD
  • ✅ Check: CMD/ENTRYPOINT uses JSON notation
  • ✅ Check: Labels included (maintainer, version)
Step 4: Dockerfile Issue Classification

Classify findings by severity:

CRITICAL (Must Fix):

  • Running as root user
  • Using :latest tags
  • Secrets exposed in image
  • Invalid syntax

HIGH (Should Fix):

  • No multi-stage build when applicable
  • No HEALTHCHECK
  • Package versions not pinned
  • Security vulnerabilities

MEDIUM (Recommended):

  • Using ADD instead of COPY
  • Not cleaning package cache
  • Missing labels
  • Inefficient layer structure

LOW (Nice to Have):

  • Could use slimmer base image
  • Could combine more RUN commands
  • Could improve comments

Phase 3: Docker Compose Validation

Step 1: Locate Compose Files

Find all Docker Compose files:

find . -maxdepth 3 -type f \( -name "docker-compose*.yml" -o -name "docker-compose*.yaml" -o -name "compose*.yml" \)
Step 2: Check for Obsolete Version Field

CRITICAL CHECK: Modern Docker Compose (v2.27.0+) does NOT use version field

# Check for obsolete version field
if grep -q "^version:" docker-compose.yml; then
    echo "❌ ERROR: Found obsolete 'version' field"
    echo "Remove 'version:' line - it's obsolete in Compose v2.27.0+"
fi

Old (Deprecated):

version: '3.8'  # ❌ REMOVE THIS
services:
  web:
    image: nginx:latest

New (Modern):

# No version field!
services:
  web:
    image: nginx:1.24-alpine
Step 3: Built-in Docker Compose Validation
# Syntax validation
docker compose config --quiet

# Show resolved configuration
docker compose config

# Validate specific file
docker compose -f docker-compose.prod.yml config --quiet
Step 4: DCLint Validation (if available)
# Lint compose file
dclint docker-compose.yml

# Auto-fix issues
dclint --fix docker-compose.yml

# JSON output
dclint --format json docker-compose.yml
Step 5: Manual Compose Validation

1. Image Best Practices

  • ✅ Check: No :latest tags
  • ✅ Check: Specific versions specified
  • ✅ Check: Images from trusted sources

2. Service Configuration

  • ✅ Check: Restart policies defined
  • ✅ Check: Health checks configured
  • ✅ Check: Resource limits set (optional but recommended)
  • ✅ Check: Proper service dependencies (depends_on)

3. Networking

  • ✅ Check: Custom networks defined
  • ✅ Check: Network isolation implemented
  • ✅ Check: Appropriate network drivers used

4. Volumes & Persistence

  • ✅ Check: Named volumes for persistence
  • ✅ Check: Volume drivers specified
  • ✅ Check: Bind mounts use absolute paths
  • ✅ Check: No sensitive data in volumes

5. Environment & Secrets

  • ✅ Check: Environment variables properly managed
  • ✅ Check: No hardcoded secrets
  • ✅ Check:.env file usage recommended
  • ✅ Check: Secrets management configured

6. Security

  • ✅ Check: No privileged mode (unless necessary)
  • ✅ Check: Capabilities properly configured
  • ✅ Check: User/group specified
  • ✅ Check: Read-only root filesystem (where applicable)

Phase 4: Multi-Stage Build Deep Dive

When validating multi-stage builds, ensure:

1. Stage Structure

# Build stage
FROM node:20-bullseye AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build && npm run test

# Production stage
FROM node:20-alpine AS runtime
WORKDIR /app
COPY --from=builder /app/dist ./dist
USER node
CMD ["node", "dist/index.js"]

2. Validation Checklist

  • ✅ At least 2 stages (build + runtime)
  • ✅ All stages are named with AS keyword
  • ✅ Artifacts copied between stages using COPY --from
  • ✅ Final stage uses minimal base image
  • ✅ Build tools NOT in final stage
  • ✅ Only necessary files in final image
  • ✅ Final stage runs as non-root user

3. Common Patterns to Check

Node.js Multi-Stage:

  • Build stage: Install all deps, build, test
  • Runtime stage: Production deps only, built artifacts

Python Multi-Stage:

  • Build stage: Compile dependencies, build wheels
  • Runtime stage: Install pre-built wheels, app only

Go Multi-Stage:

  • Build stage: Full Go toolchain, compile binary
  • Runtime stage: Scratch/distroless, binary only

Phase 5: Security Audit

Perform comprehensive security checks:

1. User & Permissions

# Check for USER directive
USER_COUNT=$(grep -c "^USER " Dockerfile)
LAST_USER=$(grep "^USER " Dockerfile | tail -1 | awk '{print $2}')

if [ "$USER_COUNT" -eq 0 ]; then
    echo "❌ CRITICAL: No USER specified (runs as root!)"
elif [ "$LAST_USER" == "root" ] || [ "$LAST_USER" == "0" ]; then
    echo "❌ CRITICAL: Final USER is root"
fi

2. Exposed Secrets

  • Check for passwords in ENV
  • Check for API keys in COPY/ADD
  • Check for credentials in RUN commands
  • Recommend secrets management solutions

3. Vulnerable Base Images

  • Check base image age and support status
  • Recommend security scanning (Trivy, Snyk)
  • Suggest pinned, supported versions

4. Network Exposure

  • Review EXPOSE directives
  • Check if unnecessary ports exposed
  • Validate port mappings in Compose

Phase 6: Generate Validation Report

Structure the validation report:

# Docker Configuration Validation Report

## Executive Summary
- **Total Dockerfiles Analyzed**: X
- **Total Compose Files Analyzed**: X
- **Critical Issues**: X
- **High Priority Issues**: X
- **Medium Priority Issues**: X
- **Low Priority Issues**: X
- **Overall Status**: ✅ PASS / ⚠️ WARNINGS / ❌ FAIL

## Dockerfile Analysis

### [Dockerfile Path]

#### Validation Results
✅ **PASSED**: Multi-stage build implemented
✅ **PASSED**: Running as non-root user
⚠️  **WARNING**: Using ADD instead of COPY (line 15)
❌ **FAILED**: Base image uses :latest tag (line 1)

#### Security Assessment
- **User**: nodejs (non-root) ✅
- **Base Image**: node:latest ❌
- **Secrets**: None detected ✅
- **Health Check**: Present ✅

#### Multi-Stage Build Analysis
- **Stages**: 2 (builder, runtime)
- **Named Stages**: Yes ✅
- **Inter-Stage Copies**: 1 ✅
- **Final Base**: node:20-alpine ✅
- **Build Tools in Final**: No ✅

#### Issues Found

**CRITICAL:**
1. Line 1: Using :latest tag
   - Issue: `FROM node:latest`
   - Fix: `FROM node:20-bullseye`
   - Impact: Unpredictable builds, security risk

**HIGH:**
2. Line 45: Package cache not cleaned
   - Issue: `RUN apt-get install -y curl`
   - Fix: Add `&& rm -rf /var/lib/apt/lists/*`
   - Impact: Larger image size

**MEDIUM:**
3. Line 15: Using ADD instead of COPY
   - Issue: `ADD app.tar.gz /app/`
   - Fix: `COPY app.tar.gz /app/` (or extract separately)
   - Impact: Less explicit behavior

## Docker Compose Analysis

### [Compose File Path]

#### Validation Results
❌ **FAILED**: Obsolete 'version' field present
⚠️  **WARNING**: 3 services using :latest tags
✅ **PASSED**: Custom networks defined
✅ **PASSED**: Named volumes configured

#### Modern Syntax Compliance
- **Version Field**: Present ❌ (MUST REMOVE)
- **Specific Tags**: 2 of 5 services ⚠️
- **Restart Policies**: All services ✅
- **Health Checks**: 3 of 5 services ⚠️

#### Issues Found

**CRITICAL:**
1. Obsolete 'version' field
   - Issue: `version: '3.8'`
   - Fix: Remove the entire line
   - Impact: Using deprecated syntax

**HIGH:**
2. Service 'web' uses :latest tag
   - Issue: `image: nginx:latest`
   - Fix: `image: nginx:1.24-alpine`
   - Impact: Unpredictable deployments

3. No restart policy on 'cache' service
   - Issue: Missing `restart:` directive
   - Fix: Add `restart: unless-stopped`
   - Impact: Service won't auto-recover

## Recommendations

### Immediate Actions (Critical)
1. Pin all Docker image versions (remove :latest)
2. Remove obsolete 'version' field from Compose files
3. Ensure all services run as non-root users
4. Clean package manager caches in all Dockerfiles

### High Priority (Before Production)
1. Implement health checks for all services
2. Add restart policies to all Compose services
3. Set up resource limits (memory, CPU)
4. Implement proper secrets management

### Medium Priority (Best Practices)
1. Use COPY instead of ADD unless extracting archives
2. Add labels for better organization
3. Implement logging drivers
4. Add metadata to images

### Low Priority (Optimizations)
1. Consider slimmer base images where possible
2. Optimize layer caching with better ordering
3. Add comprehensive comments
4. Implement .dockerignore files

## Next Steps

1. **Fix Critical Issues** (Estimated: 30 minutes)
   - Pin image versions
   - Remove version field from Compose
   - Add USER directives

2. **Address High Priority** (Estimated: 1-2 hours)
   - Add health checks
   - Configure restart policies
   - Set resource limits

3. **Re-validate** (Estimated: 10 minutes)
   - Run validation again after fixes
   - Ensure all critical issues resolved

4. **Set Up Automation** (Estimated: 1 hour)
   - Add pre-commit hooks
   - Integrate into CI/CD
   - Schedule regular security scans

## Validation Tools Recommendations

### Install Required Tools

Hadolint (Dockerfile linter)

brew install hadolint # macOS

or

wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64

DCLint (Docker Compose linter)

npm install -g docker-compose-linter

Trivy (Security scanner)

brew install aquasecurity/trivy/trivy


### Automated Validation Script

[Provide custom validation script based on project needs]

### CI/CD Integration

[Provide GitHub Actions / GitLab CI configuration]

Deliverables

At the end of validation, provide:

  1. Comprehensive Validation Report

- Executive summary with overall status - Detailed findings per file - Issue classification (Critical → Low) - Specific fixes for each issue - Recommendations prioritized

  1. Fixed Configuration Files (if requested)

- Corrected Dockerfiles - Updated Compose files - .hadolint.yaml configuration - .dclintrc.json configuration

  1. Validation Script (if requested)

- Custom bash script for automated validation - Checks for project-specific requirements - Color-coded output - Exit codes for CI/CD

  1. CI/CD Integration (if requested)

- GitHub Actions workflow - GitLab CI configuration - Pre-commit hooks - Integration with existing pipeline

  1. Documentation

- How to run validation locally - Tool installation instructions - Best practices guide - Common issues and solutions

Validation Script Template

When user requests automated validation, create this script:

#!/bin/bash
# docker-validation.sh

set -e

# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'

ERRORS=0
WARNINGS=0

echo -e "${BLUE}╔══════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║   Docker Configuration Validator        ║${NC}"
echo -e "${BLUE}╚══════════════════════════════════════════╝${NC}"

# 1. Prerequisites check
echo -e "\n${BLUE}━━━ Checking Prerequisites ━━━${NC}"
command -v docker >/dev/null || { echo "❌ Docker not found"; exit 1; }
command -v hadolint >/dev/null || echo "⚠️  Hadolint not installed"

# 2. Dockerfile validation
echo -e "\n${BLUE}━━━ Validating Dockerfiles ━━━${NC}"
find . -name "Dockerfile*" -type f | while read df; do
    echo "Checking: $df"
    # [Validation logic here]
done

# 3. Multi-stage build check
echo -e "\n${BLUE}━━━ Checking Multi-Stage Builds ━━━${NC}"
# [Multi-stage validation logic]

# 4. Compose validation
echo -e "\n${BLUE}━━━ Validating Docker Compose ━━━${NC}"
find . -name "*compose*.yml" | while read cf; do
    # Check for obsolete version field
    if grep -q "^version:" "$cf"; then
        echo -e "${RED}❌ $cf: Obsolete version field${NC}"
        ERRORS=$((ERRORS + 1))
    fi

    # Validate syntax
    docker compose -f "$cf" config --quiet || ERRORS=$((ERRORS + 1))
done

# 5. Security checks
echo -e "\n${BLUE}━━━ Security Audit ━━━${NC}"
# [Security validation logic]

# Final report
echo -e "\n${BLUE}╔══════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║         Validation Summary               ║${NC}"
echo -e "${BLUE}╚══════════════════════════════════════════╝${NC}"

if [ $ERRORS -eq 0 ]; then
    echo -e "${GREEN}✅ All checks passed!${NC}"
    exit 0
else
    echo -e "${RED}❌ Found $ERRORS error(s), $WARNINGS warning(s)${NC}"
    exit 1
fi

CI/CD Integration Templates

GitHub Actions

name: Docker Validation

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main ]

jobs:
  validate:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Lint Dockerfiles
        uses: hadolint/hadolint-action@v3.1.0
        with:
          dockerfile: ./Dockerfile
          failure-threshold: error

      - name: Validate Compose files
        run: |
          for f in $(find . -name "*compose*.yml"); do
            docker compose -f "$f" config --quiet
          done

      - name: Check for obsolete version field
        run: |
          if grep -r "^version:" . --include="*compose*.yml"; then
            echo "ERROR: Found obsolete version field"
            exit 1
          fi

GitLab CI

stages:
  - validate

docker-validation:
  stage: validate
  image: hadolint/hadolint:latest-debian
  script:
    - find . -name "Dockerfile*" -exec hadolint {} \;
    - |
      for f in $(find . -name "*compose*.yml"); do
        if grep -q "^version:" "$f"; then
          echo "ERROR: Obsolete version field in $f"
          exit 1
        fi
      done

Communication Style

When conducting validation:

  1. Be Thorough

- Check all aspects systematically - Don't skip manual checks if tools unavailable - Validate both syntax and best practices

  1. Prioritize Clearly

- Critical issues first (security, functionality) - High priority next (production readiness) - Medium and low as improvements

  1. Provide Specific Fixes

- Show exact line numbers - Provide before/after code - Explain why the fix is needed - Include impact assessment

  1. Educate

- Explain Docker best practices - Reference official documentation - Provide learning resources - Share modern syntax requirements

  1. Be Actionable

- Give step-by-step remediation - Provide automation scripts - Suggest CI/CD integration - Estimate effort for fixes

Common Validation Patterns

Pattern 1: Quick Syntax Check

  • Run Hadolint and DCLint
  • Check for obsolete version field
  • Validate with Docker Compose config
  • Report critical syntax errors only

Pattern 2: Full Production Audit

  • Complete Dockerfile validation
  • Multi-stage build verification
  • Security audit
  • Compose best practices
  • Generate comprehensive report
  • Provide automation scripts

Pattern 3: Security-Focused Review

  • User privilege checks
  • Secret exposure scan
  • Base image security
  • Network exposure audit
  • Security scanning integration

Pattern 4: Optimization Review

  • Multi-stage build effectiveness
  • Layer optimization
  • Image size analysis
  • Build time improvements
  • Caching strategies

Key Rules to Enforce

Dockerfile Rules (Critical)

  • ✅ No :latest tags (DL3006)
  • ✅ Last USER not root (DL3002)
  • ✅ Use absolute WORKDIR (DL3000)
  • ✅ Pin package versions (DL3008, DL3013)
  • ✅ Clean package cache (DL3009)

Docker Compose Rules (Critical)

  • ✅ NO version field (obsolete since v2.27.0)
  • ✅ No :latest tags
  • ✅ Restart policies defined
  • ✅ Health checks configured
  • ✅ Named volumes for persistence

Multi-Stage Build Rules

  • ✅ Minimum 2 stages
  • ✅ Named stages with AS
  • ✅ COPY --from for artifacts
  • ✅ Minimal final base image
  • ✅ No build tools in final stage

Security Rules (Critical)

  • ✅ Run as non-root USER
  • ✅ No secrets in images
  • ✅ Minimal base images
  • ✅ Regular security scans
  • ✅ Least privilege principle

Reference Resources

When providing recommendations, reference:

  • Docker Best Practices: Official Docker documentation
  • Hadolint Rules: Complete rule reference
  • Compose Specification: Latest Compose spec
  • Security Standards: CIS Docker Benchmark
  • Multi-Stage Builds: Official guide and examples

Remember: Docker validation is about ensuring reliable, secure, and efficient containerized applications. Always prioritize security and production readiness while maintaining developer experience.

平台分布

Antigravity

28.19%
按下载量换算839

Claude Code

21.32%
按下载量换算634

Gemini CLI

20%
按下载量换算595

OpenCode

13.85%
按下载量换算412

Codex

7.93%
按下载量换算236

trae

3.84%
按下载量换算114

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills