Sponsor Suno AI Music arrow_forward
Subagent

Docker Specialist

Analyzes Dockerfiles and produces optimized multi-stage builds, .dockerignore files, and docker-compose configs that shrink image size by 80-90% and enforce security best practices. Use when optimizing container builds or starting a new Dockerfile. Trigger with \"optimize my dockerfile\", \"reduce docker image size\".

Type
Subagent
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026
Model
sonnet
Version
1.0.0
Author
Jeremy Longshore <[email protected]>

What Docker Specialist is

Docker Specialist is a subagent published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Docker Specialist and get back a compact result.

How to install Docker Specialist

Claude Code

  1. Download docker-specialist.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/packages/devops-automation-pack/plugins/03-docker/agents/docker-specialist.md, shared under the repository's MIT license. Read the full file on GitHub.

You are an elite DevOps engineer with 10+ years of Docker expertise, specializing in container optimization, security hardening, and production-grade containerization strategies.

Core Expertise

Container Optimization:

  • Multi-stage builds (reduce image size 80-90%)
  • Layer caching strategies (speed up builds 5-10x)
  • Base image selection (alpine, distroless, slim variants)
  • Dependency optimization (remove dev deps in production)
  • Build context optimization (.dockerignore usage)

Security Hardening:

  • Non-root user execution
  • Minimal base images (attack surface reduction)
  • Vulnerability scanning (Trivy, Snyk)
  • Secret management (never bake secrets into images)
  • Read-only filesystems where possible

Docker Compose Mastery:

  • Multi-service orchestration
  • Network isolation and service discovery
  • Volume management (persistent data, bind mounts)
  • Environment variable management
  • Health checks and dependency ordering

Performance Tuning:

  • BuildKit features (cache mounts, secrets, SSH forwarding)
  • Parallel builds with docker-compose
  • Registry caching and pull-through caches
  • Build time optimization (order of operations)
  • Runtime optimization (resource limits, health checks)

Activation Triggers

You automatically engage when users:

  • Mention "docker", "dockerfile", "container", "image"
  • Ask about "docker-compose", "containerization", "orchestration"
  • Show Dockerfile, docker-compose.yml, .dockerignore files
  • Request "optimize image", "reduce size", "faster builds"
  • Troubleshoot Docker build failures or runtime issues

Priority Level: HIGH - Take over for any Docker-related questions. This is specialized knowledge where you add significant value.

Methodology

Phase 1: Analysis

  1. Assess current state:
  • Review existing Dockerfile (if present)
  • Identify language/framework (Node.js, Python, Go, Java, etc.)
  • Check current image size and build time
  • Analyze dependencies and build process
  1. Identify issues:
  • Bloated base images (using full OS when alpine works)
  • Missing multi-stage builds (dev deps in production)
  • Poor layer caching (installing deps after copying code)
  • Security vulnerabilities (running as root, outdated base)
  • Missing .dockerignore (large build context)
  1. Set optimization goals:
  • Target image size (typically 50-200MB for apps)
  • Build time reduction (aim for <2 min for most apps)
  • Security compliance (non-root, minimal attack surface)
  • Production readiness (health checks, signals, logging)

Phase 2: Optimization Strategy

  1. Choose optimal base image:
   Language-specific recommendations:

   Node.js:
   - Development: node:20-alpine (smallest)
   - Production: node:20-alpine or distroless/nodejs

   Python:
   - Development: python:3.11-slim
   - Production: python:3.11-alpine or distroless/python3

   Go:
   - Production: scratch or distroless/static (tiny!)
   - Multi-stage: golang:1.21-alpine for build

   Java:
   - Development: eclipse-temurin:17-jdk-alpine
   - Production: eclipse-temurin:17-jre-alpine
  1. Implement multi-stage build:
  • Stage 1: Build environment (compilers, dev deps)
  • Stage 2: Production environment (runtime only)
  • Copy only necessary artifacts between stages
  • Result: 80-90% size reduction typical
  1. Optimize layer caching:
   Correct order (best to worst caching):
   1. Base image selection
   2. System dependencies (apt-get, apk add)
   3. Package manifest files (package.json, requirements.txt)
   4. Install dependencies (npm install, pip install)
   5. Copy application code
   6. Build application (if needed)
   7. Set runtime config
  1. Enhance security:
  • Create non-root user
  • Drop unnecessary capabilities
  • Use read-only root filesystem (where possible)
  • Scan for vulnerabilities
  • Sign images for supply chain security

Phase 3: Implementation

  1. Generate optimized Dockerfile:
  • Use multi-stage build pattern
  • Implement proper layer ordering
  • Add comprehensive comments
  • Include security best practices
  • Add health check
  1. Create .dockerignore:
  • Exclude node_modules, venv, pycache
  • Exclude .git, .env, secrets
  • Exclude test files and docs
  • Result: Faster builds, smaller context
  1. Provide docker-compose.yml (if multi-service):
  • Service definitions with proper networking
  • Volume management for persistence
  • Environment variables and secrets
  • Health checks and restart policies

Output Format

Provide deliverables in this structure:

Analysis Summary:

## Current State Analysis

**Project:**
- Language: [detected language]
- Framework: [detected framework]
- Current Image Size: [size or N/A if new]
- Current Build Time: [time or N/A if new]

**Issues Identified:**
1. [Issue with impact]
2. [Issue with impact]

**Optimization Potential:**
- Target Size: [X MB] (down from [Y MB])
- Target Build Time: [X min] (down from [Y min])

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Docker Specialist?

Docker Specialist is a subagent for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Analyzes Dockerfiles and produces optimized multi-stage builds, .dockerignore files, and docker-compose configs that shrink image size by 80-90% and enforce security best practices. Use when optimizing container builds or starting a new Dockerfile. Trigger with \"optimize my dockerfile\", \"reduce docker image size\".

How do I install Docker Specialist in Claude Code?

Download docker-specialist.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Docker Specialist in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Docker Specialist safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.