New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Container build and deployment plugin that enforces non-root, minimal images with Skaffold testing.

version
2.11.5
GitHub stars
60
View on GitHub

What it does

  • Adds container-build agent and skills for Docker, multi-stage builds, and Skaffold, with 3 language-specific image optimization skills
  • Covers Dockerfile and docker-compose work, Go, Node.js, and Python slimming (Go to 2.5MB, Node.js to ~100MB, Python to ~120MB), and Skaffold file sync and testing
  • Enforces mandatory non-root users and minimal base images, with Trivy or Grype scanning and health checks for Kubernetes probes
  • Designed for local Kubernetes development on OrbStack, and for release and handoff documentation around deployments

Container development and deployment - Docker, registry, Skaffold

Add marketplace

/plugin marketplace add laurigates/claude-plugins

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install container-plugin@laurigates-claude-plugins

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

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

Start from the annotated builder/runtime template in references/multi-stage-template.md (non-root user, COPY --from=builder, HEALTHCHECK), then meet every requirement below.

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

Skaffold Preference

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

Container Labels (OCI Annotations)

When publishing to GHCR or adding image metadata, use references/oci-labels.md: the required (org.opencontainers.image.source, .description, .licenses) and recommended labels, and how to set them in a Dockerfile, at build time, or via docker/metadata-action.

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 scandocker scout cves app:latest | head -50Quick 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

Readme

Container Plugin

A comprehensive Claude plugin for container development and deployment workflows, focusing on Docker, Skaffold, and Kubernetes.

Overview

This plugin provides expert knowledge and tooling for:

  • Docker container development with security-first practices
  • Multi-stage builds and image optimization
  • Skaffold workflows for local Kubernetes development
  • OrbStack-optimized configurations
  • Deployment automation and handoff documentation
  • 12-factor app methodology

Contents

Skills

container-development

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

Key Features:

  • Security-first philosophy (mandatory non-root users, minimal base images)
  • Multi-stage Docker builds for production-ready images
  • Image optimization and vulnerability scanning
  • 12-factor app compliance
  • Comprehensive reference documentation

Use when:

  • Working with Docker, Dockerfiles, or Containerfiles
  • Building container images
  • Implementing container security best practices
  • Following 12-factor app principles
  • Optimizing container builds

Reference Documentation:

  • Multi-stage build patterns
  • 12-factor app principles implementation
  • Security best practices
  • Skaffold workflows
  • Docker Compose patterns
  • Performance optimization
  • Advanced Dockerfile patterns
skaffold-orbstack

OrbStack-optimized Skaffold workflows for local Kubernetes development without port-forwarding.

Key Features:

  • Port-forward-free development with OrbStack
  • LoadBalancer auto-provisioning
  • Wildcard DNS support (*.k8s.orb.local)
  • Direct service access from macOS
  • Ingress controller setup and configuration

Use when:

  • Configuring Skaffold with OrbStack
  • Accessing services via LoadBalancer or Ingress
  • Eliminating port-forward complexity
  • Setting up local Kubernetes development

Advantages over minikube/kind:

  • Automatic LoadBalancer provisioning
  • Native DNS resolution (cluster.local)
  • Direct pod IP access from host
  • Auto HTTPS certificates
skaffold-testing

Container image validation with Skaffold test and verify stages for robust CI/CD pipelines.

Key Features:

  • Container structure tests for image hygiene
  • Custom tests for security scanning (Grype, Trivy)
  • Post-deployment verification with the verify stage
  • Profile-based testing (quick vs thorough)
  • Essential security test templates

Use when:

  • Configuring pre-deploy image validation
  • Setting up security scanning in CI
  • Implementing post-deployment integration tests
  • Creating robust container testing pipelines

Testing Lifecycle:

Build → Test → Deploy → Verify
         ↑               ↑
    Pre-deploy      Post-deploy

Test Types:

  • structureTests: Validate image contents (files, commands, metadata)
  • custom: Run arbitrary commands (security scans, unit tests)
  • verify: Post-deployment integration tests
skaffold-filesync

Fast iterative development with Skaffold file sync - copy changed files to running containers without rebuilding images.

Key Features:

  • Three sync modes: manual, infer, and auto
  • Hot reload support for interpreted languages
  • Static asset synchronization
  • Directory stripping for complex layouts
  • Zero-config support for Buildpacks and Jib

Use when:

  • Optimizing the development loop
  • Setting up hot reload in Kubernetes
  • Syncing source code to running containers
  • Avoiding unnecessary image rebuilds

Sync Modes:

ModeBest For
manualFull control, complex directory layouts
inferDocker builds, derives destinations from Dockerfile
autoBuildpacks, Jib - zero configuration

Speed Comparison:

Without sync: Edit → Build → Deploy → Restart (~30-60s)
With sync:    Edit → Copy → Test (~1-2s)
deploy-release

Create and publish a new release with release-please automation.

Features:

  • Manifest-based release configuration
  • Automatic version number updates across files
  • GitHub release integration

Usage:

claude chat --file ~/.claude/skills/deploy-release/SKILL.md <version> [--draft] [--prerelease]
deploy-handoff

Generate professional deployment handoff documentation for resources and services.

Features:

  • Automatic repository and deployment context detection
  • Professional formatting for handoff messages
  • Comprehensive service documentation
  • Developer handoff checklists
  • Access information and monitoring links

Usage:

# Basic handoff for current project
/container:deploy-handoff

# Specific service handoff
/container:deploy-handoff "User API" "web-service"

Output includes:

  • Service overview and technical details
  • Access URLs and endpoints
  • Documentation links
  • Developer handoff checklist
  • Support and contact information

Installation

Option 1: Copy to .claude directory (Manual)

# Copy the entire plugin directory
cp -r container-plugin ~/.claude/plugins/container-plugin

Option 2: Symlink (Development)

# Create symlink for development
ln -s "$(pwd)/container-plugin" ~/.claude/plugins/container-plugin

Option 3: chezmoi (Recommended)

If using chezmoi for dotfile management:

# Add to chezmoi source directory
cp -r container-plugin ~/.local/share/chezmoi/exact_dot_claude/plugins/exact_container-plugin

# Apply changes
chezmoi apply ~/.claude

Usage

Once installed, the skills and commands are automatically available in Claude Code.

Skills Activation

Skills are automatically activated when relevant keywords are detected:

container-development: Docker, Dockerfile, containers, docker-compose, multi-stage builds, container images, container security, 12-factor app

skaffold-orbstack: OrbStack, k8s.orb.local, Skaffold, service access, port-forward

skaffold-testing: skaffold test, skaffold verify, container-structure-test, image testing, security scanning, Grype, Trivy, pre-deploy validation

skaffold-filesync: file sync, hot reload, live reload, fast iteration, sync rules, copy files to container

Skill Usage

Skills can be invoked using the Claude chat interface:

# Release automation
claude chat --file ~/.claude/skills/deploy-release/SKILL.md 1.0.0

# Deployment handoff
/container:deploy-handoff "My Service" "api"

Security Philosophy

This plugin enforces strict security best practices:

Mandatory Requirements

  • Non-root users: ALL production containers MUST run as non-root
  • Minimal base images: Alpine (~5MB) for Node.js/Go/Rust, slim (~50MB) for Python
  • Multi-stage builds: Separate build and runtime environments
  • Vulnerability scanning: Trivy or Grype integration in CI
  • Health checks: Required for Kubernetes probes

Image Size Guidelines

  • Alpine base: ~5MB
  • Debian slim: ~50-70MB
  • Distroless: ~2MB (no shell)

Best Practices

Container Development

  1. Use multi-stage builds to minimize image size
  2. Run containers as non-root users
  3. Pin specific image versions (avoid latest)
  4. Implement health checks
  5. Follow 12-factor app principles
  6. Scan images for vulnerabilities

Skaffold Workflows

  1. Use OrbStack for superior local Kubernetes networking
  2. Prefer LoadBalancer services over port-forwarding
  3. Leverage Ingress for pretty URLs
  4. Configure proper health checks and readiness probes
  5. Use profiles for different environments

Deployment

  1. Generate comprehensive handoff documentation
  2. Include monitoring and logging information
  3. Document access URLs and endpoints
  4. Provide developer checklists
  5. Maintain professional communication style

Dependencies

Container Development

  • Docker or compatible container runtime
  • BuildKit (for cache mounts and optimizations)
  • Trivy or Grype (for security scanning)

Skaffold Testing

  • container-structure-test binary
  • Grype or Trivy (for vulnerability scanning)
  • Skaffold v2.0+ (for verify stage)

Skaffold Workflows

  • OrbStack (recommended) or minikube/kind
  • kubectl
  • Skaffold
  • Ingress controller (ingress-nginx or Traefik)

Deployment Commands

  • Git
  • GitHub CLI (optional, for release automation)

Related Resources

Documentation

Security

Version

1.0.0

Keywords

container, docker, dockerfile, registry, skaffold, deployment, kubernetes, orbstack, 12-factor, multi-stage-builds, security, image-optimization, container-structure-test, grype, trivy, verify, image-testing, filesync, hot-reload, live-reload

License

This plugin is part of the claude-plugins repository and follows the same license terms.

Contributing

Contributions are welcome! Please ensure:

  • New container patterns follow security best practices
  • Documentation is comprehensive and clear
  • Examples are tested and verified
  • Skills include appropriate trigger keywords

Support

For issues, questions, or contributions:

  1. Check the reference documentation in each skill
  2. Review the examples and patterns provided
  3. Consult official documentation for Docker, Skaffold, and Kubernetes
  4. Open an issue in the claude-plugins repository

Details

Marketplace
laurigates/claude-plugins
Source
container-plugin
Author
Lauri Gates
Category
Infrastructure
License
MIT
Keywords
container, docker, registry, skaffold
Listed since
Apr 7, 2026

More from laurigates/claude-plugins

All 52

Similar to container-plugin

More DevOps & Cloud