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

container-development容器开发

Agent Skill

container-development 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,434

周安装

58

GitHub Stars

28

下载量

450
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill container-development

简介

Container Development 提供安全优先的容器化开发专业知识。

  • 聚焦精简镜像、12-factor 应用、多阶段构建与语言特定优化技巧。
  • 推荐使用 scratch、distroless 或 Alpine 变体减少攻击面与体积。
  • 适合构建轻量、可审计且符合合规要求的容器化服务。
  • container-development 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Container Development

Expert knowledge for containerization and orchestration with focus on security-first, lean container images and 12-factor app methodology.

When to Use This Skill

Use this skill when...Use a language-specific sibling (go-containers, nodejs-containers, python-containers) instead when...
Writing or optimizing language-agnostic DockerfilesOptimizing Go static binaries, Node.js Alpine builds, or Python slim images
Authoring multi-stage build patterns or 12-factor configurationThe image-size goal is dominated by language runtime choices (scratch, distroless, musl/glibc)
Hardening containers (non-root, minimal base, secrets)Running Skaffold sync (skaffold-filesync) or OrbStack networking (skaffold-orbstack)
Composing services with Docker ComposeThe work is purely a Skaffold pre-deploy test (skaffold-testing)

Security Philosophy (Non-Negotiable)

Non-Root is MANDATORY: ALL production containers MUST run as non-root users. This is not optional.

Minimal Base Images: Use Alpine (~5MB) for Node.js/Go/Rust. Use slim (~50MB) for Python (musl compatibility issues with Alpine).

Multi-Stage Builds Required: Separate build and runtime environments. Build tools should NOT be in production images.

Core Expertise

Container Image Construction

  • Dockerfile/Containerfile Authoring: Clear, efficient, and maintainable container build instructions
  • Multi-Stage Builds: Creating minimal, production-ready images
  • Image Optimization: Reducing image size, minimizing layer count, optimizing build cache
  • Security Hardening: Non-root users, minimal base images, vulnerability scanning

Container Orchestration

  • Service Architecture: Microservices with proper service discovery
  • Resource Management: CPU/memory limits, auto-scaling policies, resource quotas
  • Health & Monitoring: Health checks, readiness probes, observability patterns
  • Configuration Management: Environment variables, secrets, configuration management

Key Capabilities

  • 12-Factor Adherence: Ensures containerized applications follow 12-factor principles, especially configuration and statelessness
  • Health & Reliability: Implements proper health checks, readiness probes, and restart policies
  • Skaffold Workflows: Structures containerized applications for efficient development loops
  • Orchestration Patterns: Designs service meshes, load balancing, and container communication
  • Performance Tuning: Optimizes container resource usage, startup times, and runtime performance

Image Crafting Process

  1. Analyze: Understand application dependencies and build process
  2. Structure: Design multi-stage Dockerfile, separating build-time from runtime needs
  3. Ignore: Create comprehensive .dockerignore file
  4. Build & Scan: Build image and scan for vulnerabilities
  5. Refine: Iterate to optimize layer caching, reduce size, address security
  6. Validate: Ensure image runs correctly and adheres to 12-factor principles

Best Practices

Core Optimization Principles

1. Multi-Stage Builds (MANDATORY):

  • Separate build-time dependencies from runtime
  • Keep build tools out of production images
  • Typical reduction: 60-90% smaller final images

2. Minimal Base Images:

  • Start with the smallest base that works
  • Prefer Alpine for most languages (except Python)
  • Consider distroless for maximum security

3. Non-Root Users (MANDATORY):

  • Always create and use non-root user
  • Set UID/GID explicitly (e.g., 1001)
  • Security compliance requirement

4..dockerignore (MANDATORY):

  • Exclude .git, node_modules, __pycache__
  • Prevent secrets and dev files from entering image
  • Reduces build context by 90-98%

5. Layer Optimization:

  • Copy dependency manifests separately from source
  • Put frequently changing layers last
  • Combine related RUN commands with &&

Version Checking

CRITICAL: Before using base images, verify latest versions:

Use WebSearch or WebFetch to verify current versions.

Language-Specific Optimization

For detailed language-specific optimization patterns, see the dedicated skills:

LanguageSkillKey OptimizationTypical Reduction
Gogo-containersStatic binaries, scratch/distroless846MB → 2.5MB (99.7%)
Node.jsnodejs-containersAlpine, multi-stage, npm/yarn/pnpm900MB → 100MB (89%)
Pythonpython-containersSlim (NOT Alpine), uv, venv1GB → 100MB (90%)

Quick Base Image Guide

Choose the right base image:

  • Go: scratch or distroless/static (2-5MB)
  • Node.js: node:XX-alpine (50-150MB)
  • Python: python:XX-slim (80-120MB) - Never use Alpine for Python!
  • Nginx: nginx:XX-alpine (20-40MB)
  • Static files: scratch or nginx:alpine (minimal)

Multi-Stage Build Template

# Build stage - includes all build tools
FROM <language>:<version> AS builder
WORKDIR /app

# Copy dependency manifests first (better caching)
COPY package.json package-lock.json ./  # or go.mod, requirements.txt, etc.

# Install dependencies
RUN <install-command>

# Copy source code
COPY . .

# Build application
RUN <build-command>

# Runtime stage - minimal
FROM <minimal-base>
WORKDIR /app

# Create non-root user
RUN addgroup --gid 1001 appgroup && \
    adduser --uid 1001 --gid 1001 --disabled-password appuser

# Copy only what's needed from builder
COPY --from=builder --chown=appuser:appuser /app/dist ./dist

USER appuser
EXPOSE <port>

HEALTHCHECK --interval=30s CMD <health-check-command>

CMD [<start-command>]

Security Requirements (Mandatory)

  • Non-root user: REQUIRED - never run as root in production
  • Minimal base images: Choose smallest viable base

- Typical CVE reduction: 50-100% (full base: 50-70 CVEs → minimal: 0-12 CVEs) - No shell = no shell injection attacks - No package manager = no supply chain attacks

  • Multi-stage builds: REQUIRED - keep build tools out of runtime
  • HEALTHCHECK: REQUIRED for Kubernetes liveness/readiness probes
  • Vulnerability scanning: Use Trivy, Grype, or Docker Scout in CI
  • Version pinning: Always use specific tags (e.g., node:20.10-alpine), never latest
  • .dockerignore: REQUIRED - prevents secrets,.env,.git from entering image

Typical Impact of Full Optimization:

  • Image size: 85-99% reduction
  • Security: 70-100% fewer CVEs
  • Pull time: 80-98% faster
  • Build time: 40-60% faster (with proper caching)
  • Memory usage: 60-80% lower
  • Storage costs: 90-99% reduction

12-Factor App Principles

  • Configuration via environment variables
  • Stateless processes
  • Explicit dependencies
  • Port binding for services
  • Graceful shutdown handling

Container Labels (OCI Annotations)

Container labels provide metadata for image discovery, linking, and documentation. GitHub Container Registry (GHCR) specifically supports OCI annotations to link images to repositories and display descriptions.

Required Labels for GHCR

LabelPurposeExample
org.opencontainers.image.sourceLinks image to repository (enables GHCR features)https://github.com/owner/repo
org.opencontainers.image.descriptionPackage description (max 512 chars)Production API server
org.opencontainers.image.licensesSPDX license identifier (max 256 chars)MIT, Apache-2.0

Recommended Labels

LabelPurposeExample
org.opencontainers.image.versionSemantic version1.2.3
org.opencontainers.image.revisionGit commit SHAabc1234
org.opencontainers.image.createdBuild timestamp (RFC 3339)2025-01-19T12:00:00Z
org.opencontainers.image.titleHuman-readable nameMy Application
org.opencontainers.image.vendorOrganization nameForum Virium Helsinki
org.opencontainers.image.urlProject homepagehttps://example.com
org.opencontainers.image.documentationDocumentation URLhttps://docs.example.com

Adding Labels in Dockerfile

# Static labels (set at build time)
LABEL org.opencontainers.image.source="https://github.com/owner/repo" \
      org.opencontainers.image.description="Production API server" \
      org.opencontainers.image.licenses="MIT" \
      org.opencontainers.image.vendor="Forum Virium Helsinki"

# Dynamic labels (via build args)
ARG VERSION=dev
ARG BUILD_DATE
ARG VCS_REF

LABEL org.opencontainers.image.version="${VERSION}" \
      org.opencontainers.image.created="${BUILD_DATE}" \
      org.opencontainers.image.revision="${VCS_REF}"

Adding Labels at Build Time

docker build \
  --label "org.opencontainers.image.source=https://github.com/owner/repo" \
  --label "org.opencontainers.image.description=My container image" \
  --label "org.opencontainers.image.licenses=MIT" \
  --build-arg VERSION=1.2.3 \
  --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --build-arg VCS_REF=$(git rev-parse --short HEAD) \
  -t myapp:1.2.3 .

GitHub Actions with docker/metadata-action

The docker/metadata-action automatically generates OCI labels from repository metadata:

- id: meta
  uses: docker/metadata-action@v5
  with:
    images: ghcr.io/${{ github.repository }}
    labels: |
      org.opencontainers.image.title=My Application
      org.opencontainers.image.description=Production API server
      org.opencontainers.image.vendor=Forum Virium Helsinki

- uses: docker/build-push-action@v6
  with:
    labels: ${{ steps.meta.outputs.labels }}

Auto-generated labels by metadata-action:

  • org.opencontainers.image.source (from repository URL)
  • org.opencontainers.image.revision (from commit SHA)
  • org.opencontainers.image.created (build timestamp)
  • org.opencontainers.image.version (from tags/refs)

Skaffold Preference

  • Favor Skaffold over Docker Compose for local development
  • Continuous development loop with hot reload
  • Production-like local environment

Agentic Optimizations

When building and testing containers, use these optimizations for faster feedback:

ContextCommandPurpose
Quick buildDOCKER_BUILDKIT=1 docker build --progress=plain -t app.BuildKit with plain output
Build with cachedocker build --cache-from app:latest -t app:new.Reuse layers from previous builds
Security scan`docker scout cves app:latest \head -50`Quick vulnerability check
Size analysisdocker images app --format "{{.Size}}"Check image size
Layer inspectiondocker history app:latest --human --no-truncAnalyze layer sizes
Build without cachedocker build --no-cache --progress=plain -t app.Force clean build
Test containerdocker run --rm -it app:latest /bin/shInteractive testing
Quick health checkdocker run --rm app:latest timeout 5 /healthVerify startup

Build optimization flags:

  • --target=<stage>: Build specific stage only (faster iteration)
  • --build-arg BUILDKIT_INLINE_CACHE=1: Enable inline cache
  • --secret id=key,src=file: Mount secrets without including in image

For detailed Dockerfile optimization techniques, orchestration patterns, security hardening, and Skaffold configuration, see REFERENCE.md.

Related Skills

Language-Specific Container Optimization:

  • go-containers - Go static binaries, scratch/distroless (846MB → 2.5MB)
  • nodejs-containers - Node.js Alpine patterns, npm/yarn/pnpm (900MB → 100MB)
  • python-containers - Python slim (NOT Alpine), uv/poetry (1GB → 100MB)

Related Commands

  • /configure:container - Comprehensive container infrastructure validation
  • /configure:dockerfile - Dockerfile-specific configuration
  • /configure:workflows - GitHub Actions including container builds
  • /configure:skaffold - Kubernetes development configuration

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.97%
按下载量换算162

Claude

29.36%
按下载量换算132

Cursor

17.1%
按下载量换算77

Gemini CLI

7.71%
按下载量换算35

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills