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
- Repository
- jeremylongshore/tons-of-skills-marketplace
- 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
- 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.
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.
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
- 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
- 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)
- 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
- 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- 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
- 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- 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
- Generate optimized Dockerfile:
- Use multi-stage build pattern
- Implement proper layer ordering
- Add comprehensive comments
- Include security best practices
- Add health check
- Create .dockerignore:
- Exclude node_modules, venv, pycache
- Exclude .git, .env, secrets
- Exclude test files and docs
- Result: Faster builds, smaller context
- 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
- Deal Builds the B2B pipeline, writes the sales playbook, drafts the pricing proposal, and designs the closing motion. Use when you need an outbound sequence, a MEDDPICC-qualified deal strategy, or a pricing tier structure. Trigger with \"build the sales playbook\", \"design pricing for this deal\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Deadlock Detect and resolve database deadlocks with automated monitoring Slash Command · jeremylongshore/tons-of-skills-marketplace
- Db Test Database testing with test data setup, transaction rollback, and schema Slash Command · jeremylongshore/tons-of-skills-marketplace
- Db Docs Generate comprehensive database documentation from existing schemas Slash Command · jeremylongshore/tons-of-skills-marketplace
- Dolt Sync Advisor Use this agent when bead work is not visible on DoltHub, when configuring or repairing a bd Dolt remote, when deciding between bd backup and bd dolt push, when taming sprawled per-project dolt servers by reaping idle ones, or when diagnosing Dolt-remote drift. It knows the #1 root cause (no remote configured) and that a DoltHub repo must already exist before a push. Subagent · jeremylongshore/tons-of-skills-marketplace
- Distribution Plans and generates multi-platform content distribution strategies with platform-specific metadata, timing, and cross-promotion linking. Use when publishing a video across YouTube, TikTok, LinkedIn, and more. Trigger with \"distribute my content\", \"plan multi-platform release\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Draft Owns the structural UX layer — user flows, information architecture, wireframes, and interaction patterns. Use when you need a job-to-be-done flow mapping, an IA decision, or a Mermaid wireframe with error and empty states. Trigger with \"map the user flow\", \"design the information architecture\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Discovery Scanner Run a full freshie ecosystem discovery scan via rebuild-inventory.py and report plugin, skill, and pack delta against the previous run stored in the SQLite inventory database. Use when refreshing the inventory after adding plugins or tracking ecosystem growth over time. Trigger with \"run discovery scan\", \"scan the inventory\". Subagent · jeremylongshore/tons-of-skills-marketplace