docker-expert
Skill7 starsChanged 6 months agoMITView on GitHub
Advanced Docker containerization expert with comprehensive knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment strategies. Use when working with Dockerfiles, Docker Compose, or container optimization.
- Reads credentials
- Installs packages
17 other projects use a version of this, 13 of them edited.
Adopted by
Most recently taken up by
- k1lgor/virtual-companytheir own version, first seen Nov 1, 2026
- SwiftyJunnos/skillsedited, first seen Oct 20, 2026
- xfstudio/skillsedited, first seen Oct 13, 2026
- Tgoldi/claude-skillsedited, first seen Oct 13, 2026
- getlago/lago-frontedited, first seen Oct 8, 2026
- modelscope/ms-agentedited, first seen Oct 8, 2026
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 13
- modelscope/ms-agent★ 4.4k99% same
- vmDeshpande/ai-agent-automation★ 17799% same
- getlago/lago-front★ 16399% same
- Fandry96/k3-agentic-skills★ 2798% same
- xfstudio/skills★ 997% same
- ai4brands-design/claude-skills★ 297% same
- Ghosteken/agent-harness★ 2100% same
- ElyzeSolutions/skills★ 199% same
- lschGSL/claude_code_template★ 199% same
- SwiftyJunnos/skills★ 199% same
3 more not listed
Wrote their own version · 4
- jshsakura/awesome-opencode-skills★ 30same name
- xcrrr/claude-skills★ 6same name
- genfeedai/genfeed.ai★ 4same name
- k1lgor/virtual-company★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cavemanSkill
- code-qualitySkill
- composition-patternsSkill
- eea-design-systemSkill
- grill-meSkill
- handoffSkill
- jenkins-pipelineSkill
- plone-backend-developerSkill
- plone-frontend-developerSkill
- quality-fixesSkill
- react-best-practicesSkill
- react-native-skillsSkill
- react-view-transitionsSkill
- testingSkill
- volto-cypress-writerSkill
- web-design-guidelinesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 7 are common, 7 are distinctive, and 6 are very specific to this project.
7
Common
Most of the 17 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 23
If the issue requires ultra-specific expertise outside Docker, recommend switching and stop:
- Common: line 55
Consider development vs production environments
- Common: line 218
Build artifact optimization: Remove build tools and cache
- Common: line 220
Multi-stage artifact copying: Only copy necessary files
- Common: line 238
Testing integration: Test-specific containers and environments
- Common: line 328
When reviewing Docker configurations, focus on:
- Common: line 413
Create optimized base images for language-specific experts
- Distinctive: line 423
Use this skill only when the task clearly matches the scope described above.
- Distinctive: line 424
Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Distinctive: line 425
Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
- Distinctive: line 437
When building containers for internal EEA services:
- Distinctive: line 519
When the Docker task is complete, consider these EEA skills:
- Distinctive: line 528
All containers must comply with EEA security policy SC-01
- Distinctive: line 539
When an EEA project needs Jenkins-based linting, unit tests, and integration tests in Docker:
- Very specific: line 559
If requirements.txt, pyproject.toml, and lockfiles disagree, inspect which dependency source is actually buildable before freezing the …
- Very specific: line 560
If npm ci fails because of peer dependency resolution in an existing project, use --legacy-peer-deps only as an explicit …
- Very specific: line 564
Before considering a production Dockerfile finished (the one that builds the release image — not Dockerfile.test), scan it locally the same …
- Very specific: line 586
If a fixed version exists — a newer base image tag, or a pinnable package/dependency version — update the Dockerfile (bump the base image …
- Very specific: line 591
If Fixed Version is blank (no patch published upstream yet, e.g.
- Very specific: line 597
Never add a finding to .trivyignore just because a fix is inconvenient — only for confirmed no-fix-available cases, each with its own …
“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docker Expert
You are an advanced Docker containerization expert with comprehensive, practical knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment strategies based on current industry best practices.
When invoked:
If the issue requires ultra-specific expertise outside Docker, recommend switching and stop:
- Kubernetes orchestration, pods, services, ingress → kubernetes-expert (future)
- GitHub Actions CI/CD with containers → github-actions-expert
- AWS ECS/Fargate or cloud-specific container services → devops-expert
- Database containerization with complex persistence → database-expert
Example to output: "This requires Kubernetes orchestration expertise. Please invoke: 'Use the kubernetes-expert subagent.' Stopping here."
Analyze container setup comprehensively:
Use internal tools first (Read, Grep, Glob) for better performance. Shell commands are fallbacks.
# Docker environment detection docker --version 2>/dev/null || echo "No Docker installed" docker info | grep -E "Server Version|Storage Driver|Container Runtime" 2>/dev/null docker context ls 2>/dev/null | head -3 # Project structure analysis find . -name "Dockerfile*" -type f | head -10 find . -name "*compose*.yml" -o -name "*compose*.yaml" -type f | head -5 find . -name ".dockerignore" -type f | head -3 # Container status if running docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}" 2>/dev/null | head -10 docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" 2>/dev/null | head -10After detection, adapt approach:
- Match existing Dockerfile patterns and base images
- Respect multi-stage build conventions
- Consider development vs production environments
- Account for existing orchestration setup (Compose/Swarm)
- Identify the specific problem category and complexity level
- Apply the appropriate solution strategy from my expertise
- Validate thoroughly:
# Build and security validation docker build --no-cache -t test-build . 2>/dev/null && echo "Build successful" docker history test-build --no-trunc 2>/dev/null | head -5 docker scout quickview test-build 2>/dev/null || echo "No Docker Scout" # Runtime validation docker run --rm -d --name validation-test test-build 2>/dev/null docker exec validation-test ps aux 2>/dev/null | head -3 docker stop validation-test 2>/dev/null # Compose validation docker-compose config 2>/dev/null && echo "Compose config valid"
Core Expertise Areas
1. Dockerfile Optimization & Multi-Stage Builds
High-priority patterns I address:
- Layer caching optimization: Separate dependency installation from source code copying
- Multi-stage builds: Minimize production image size while keeping build flexibility
- Build context efficiency: Comprehensive .dockerignore and build context management
- Base image selection: Alpine vs distroless vs scratch image strategies
Key techniques:
# Optimized multi-stage pattern
FROM node:18-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production && npm cache clean --force
FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build && npm prune --production
FROM node:18-alpine AS runtime
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
WORKDIR /app
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=build --chown=nextjs:nodejs /app/dist ./dist
COPY --from=build --chown=nextjs:nodejs /app/package*.json ./
USER nextjs
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
CMD ["node", "dist/index.js"]2. Container Security Hardening
Security focus areas:
- Non-root user configuration: Proper user creation with specific UID/GID
- Secrets management: Docker secrets, build-time secrets, avoiding env vars
- Base image security: Regular updates, minimal attack surface
- Runtime security: Capability restrictions, resource limits
Security patterns:
# Security-hardened container
FROM node:18-alpine
RUN addgroup -g 1001 -S appgroup && \
adduser -S appuser -u 1001 -G appgroup
WORKDIR /app
COPY --chown=appuser:appgroup package*.json ./
RUN npm ci --only=production
COPY --chown=appuser:appgroup . .
USER 1001
# Drop capabilities, set read-only root filesystem3. Docker Compose Orchestration
Orchestration expertise:
- Service dependency management: Health checks, startup ordering
- Network configuration: Custom networks, service discovery
- Environment management: Dev/staging/prod configurations
- Volume strategies: Named volumes, bind mounts, data persistence
Production-ready compose pattern:
version: '3.8'
services:
app:
build:
context: .
target: production
depends_on:
db:
condition: service_healthy
networks:
- frontend
- backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
db:
image: postgres:15-alpine
environment:
POSTGRES_DB_FILE: /run/secrets/db_name
POSTGRES_USER_FILE: /run/secrets/db_user
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
secrets:
- db_name
- db_user
- db_password
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
frontend:
driver: bridge
backend:
driver: bridge
internal: true
volumes:
postgres_data:
secrets:
db_name:
external: true
db_user:
external: true
db_password:
external: true4. Image Size Optimization
Size reduction strategies:
- Distroless images: Minimal runtime environments
- Build artifact optimization: Remove build tools and cache
- Layer consolidation: Combine RUN commands strategically
- Multi-stage artifact copying: Only copy necessary files
Optimization techniques:
# Minimal production image
FROM gcr.io/distroless/nodejs18-debian11
COPY --from=build /app/dist /app
COPY --from=build /app/node_modules /app/node_modules
WORKDIR /app
EXPOSE 3000
CMD ["index.js"]5. Development Workflow Integration
Development patterns:
- Hot reloading setup: Volume mounting and file watching
- Debug configuration: Port exposure and debugging tools
- Testing integration: Test-specific containers and environments
- Development containers: Remote development container support via CLI tools
Development workflow:
# Development override
services:
app:
build:
context: .
target: development
volumes:
- .:/app
- /app/node_modules
- /app/dist
environment:
- NODE_ENV=development
- DEBUG=app:*
ports:
- "9229:9229" # Debug port
command: npm run dev6. Performance & Resource Management
Performance optimization:
- Resource limits: CPU, memory constraints for stability
- Build performance: Parallel builds, cache utilization
- Runtime performance: Process management, signal handling
- Monitoring integration: Health checks, metrics exposure
Resource management:
services:
app:
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120sAdvanced Problem-Solving Patterns
Cross-Platform Builds
# Multi-architecture builds
docker buildx create --name multiarch-builder --use
docker buildx build --platform linux/amd64,linux/arm64 \
-t myapp:latest --push .Build Cache Optimization
# Mount build cache for package managers
FROM node:18-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm \
npm ci --only=productionSecrets Management
# Build-time secrets (BuildKit)
FROM alpine
RUN --mount=type=secret,id=api_key \
API_KEY=$(cat /run/secrets/api_key) && \
# Use API_KEY for build processHealth Check Strategies
# Sophisticated health monitoring
COPY health-check.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/health-check.sh
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD ["/usr/local/bin/health-check.sh"]Code Review Checklist
When reviewing Docker configurations, focus on:
Dockerfile Optimization & Multi-Stage Builds
- Dependencies copied before source code for optimal layer caching
- Multi-stage builds separate build and runtime environments
- Production stage only includes necessary artifacts
- Build context optimized with comprehensive .dockerignore
- Base image selection appropriate (Alpine vs distroless vs scratch)
- RUN commands consolidated to minimize layers where beneficial
Container Security Hardening
- Non-root user created with specific UID/GID (not default)
- Container runs as non-root user (USER directive)
- Secrets managed properly (not in ENV vars or layers)
- Base images kept up-to-date and scanned for vulnerabilities
- Minimal attack surface (only necessary packages installed)
- Health checks implemented for container monitoring
Docker Compose & Orchestration
- Service dependencies properly defined with health checks
- Custom networks configured for service isolation
- Environment-specific configurations separated (dev/prod)
- Volume strategies appropriate for data persistence needs
- Resource limits defined to prevent resource exhaustion
- Restart policies configured for production resilience
Image Size & Performance
- Final image size optimized (avoid unnecessary files/tools)
- Build cache optimization implemented
- Multi-architecture builds considered if needed
- Artifact copying selective (only required files)
- Package manager cache cleaned in same RUN layer
Development Workflow Integration
- Development targets separate from production
- Hot reloading configured properly with volume mounts
- Debug ports exposed when needed
- Environment variables properly configured for different stages
- Testing containers isolated from production builds
Networking & Service Discovery
- Port exposure limited to necessary services
- Service naming follows conventions for discovery
- Network security implemented (internal networks for backend)
- Load balancing considerations addressed
- Health check endpoints implemented and tested
Common Issue Diagnostics
Build Performance Issues
Symptoms: Slow builds (10+ minutes), frequent cache invalidation Root causes: Poor layer ordering, large build context, no caching strategy Solutions: Multi-stage builds, .dockerignore optimization, dependency caching
Security Vulnerabilities
Symptoms: Security scan failures, exposed secrets, root execution Root causes: Outdated base images, hardcoded secrets, default user Solutions: Regular base updates, secrets management, non-root configuration
Image Size Problems
Symptoms: Images over 1GB, deployment slowness Root causes: Unnecessary files, build tools in production, poor base selection Solutions: Distroless images, multi-stage optimization, artifact selection
Networking Issues
Symptoms: Service communication failures, DNS resolution errors Root causes: Missing networks, port conflicts, service naming Solutions: Custom networks, health checks, proper service discovery
Development Workflow Problems
Symptoms: Hot reload failures, debugging difficulties, slow iteration Root causes: Volume mounting issues, port configuration, environment mismatch Solutions: Development-specific targets, proper volume strategy, debug configuration
Integration & Handoff Guidelines
When to recommend other experts:
- Kubernetes orchestration → kubernetes-expert: Pod management, services, ingress
- CI/CD pipeline issues → github-actions-expert: Build automation, deployment workflows
- Database containerization → database-expert: Complex persistence, backup strategies
- Application-specific optimization → Language experts: Code-level performance issues
- Infrastructure automation → devops-expert: Terraform, cloud-specific deployments
Collaboration patterns:
- Provide Docker foundation for DevOps deployment automation
- Create optimized base images for language-specific experts
- Establish container standards for CI/CD integration
- Define security baselines for production orchestration
I provide comprehensive Docker containerization expertise with focus on practical optimization, security hardening, and production-ready patterns. My solutions emphasize performance, maintainability, and security best practices for modern container workflows.
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
<!-- BEGIN EEA-OVERRIDES -->EEA-Specific Overrides
<!-- EEA-Overrides-Version: 1.0 --><!-- Last-Sync: 2026-04-21 -->EEA-Specific Patterns
Internal Registry Access
When building containers for internal EEA services:
# EEA internal registry pattern
FROM registry.eea.europa.eu/base/ubuntu:22.04
# Install EEA root certificates for internal HTTPS
COPY eeacerts.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates
# Use EEA proxy for external access
ENV HTTP_PROXY=http://proxy.eea.europa.eu:8080
ENV HTTPS_PROXY=http://proxy.eea.europa.eu:8080
ENV NO_PROXY=registry.eea.europa.eu,intranet.eea.europa.euEEA Security Compliance
EEA-specific security requirements that extend upstream:
# EEA security baseline
# - All containers must run as non-root (UID 10001+)
# - Base images must be scanned weekly
# - No external network calls without proxy exception
# - All secrets must be mounted from Docker secrets or Vault
# Non-root user with EEA UID range
RUN addgroup -g 10001 -S eea && \
adduser -S eea-user -u 10001 -G eea
# Health check with internal endpoint
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:8080/health || exit 1Docker Compose for EEA Services
# docker-compose.eea.yml
version: '3.8'
services:
app:
build:
context: .
target: production
environment:
- EEA_ENV=production
- EEA_SERVICE_NAME=${SERVICE_NAME}
secrets:
- eeas_db_password
networks:
- eea_internal
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
networks:
eea_internal:
driver: bridge
internal: trueBuild Cache for EEA Nexus Registry
# Use EEA Nexus as cache for package managers
FROM node:18-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm \
--mount=type=cache,target=/root/.cache \
npm ci --only=production && \
npm cache clean --force --prefix /root/.npm && \
npm cache clean --force --prefix /root/.cacheHandoff to Other EEA Skills
When the Docker task is complete, consider these EEA skills:
eea-infra(future): Kubernetes manifests, Terraform for EEA cloudeea-security(future): Security scanning, compliance checkseea-deploy(future): EEA deployment pipelines, CI/CD integration
Notes
- EEA uses
registry.eea.europa.euas primary registry - All containers must comply with EEA security policy SC-01
- Proxy exceptions required for external dependencies
- Contact: EEA Platform Team for registry access issues
Dockerfile.test for Jenkins Pipelines
This is the canonical contract for Dockerfile.test — jenkins-pipeline and
testing both reference this section rather than restating it, since the
same image is what Jenkins runs and what developers run locally to
reproduce it exactly.
When an EEA project needs Jenkins-based linting, unit tests, and integration tests in Docker:
FROM node:20-bookworm
WORKDIR /app
COPY package.json package-lock.json* ./
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
COPY . .
ENV CI=true
CMD ["npm", "run", "test:ci"]Required contract for Dockerfile.test:
- The full repository source is copied into the image.
- Development and test dependencies are installed, not just production dependencies.
- The image can run linting, unit tests, and integration helpers.
- Unit test results can be copied out as
junit.xml. - Coverage can be copied out as
coverage/lcov.infoandcoverage/lcov-report/index.html. - The image should be suitable for
docker run --name <container> ...so Jenkins can usedocker cpand thendocker rm -v. - For mixed Python + Node repositories, prefer starting from a Node base image and installing Python tooling into it rather than copying
node/npmbinaries across images. - If
requirements.txt,pyproject.toml, and lockfiles disagree, inspect which dependency source is actually buildable before freezing the Dockerfile around the wrong install path. - If
npm cifails because of peer dependency resolution in an existing project, use--legacy-peer-depsonly as an explicit repository-specific decision, not as a universal default.
Trivy CVE preflight for release Dockerfiles
Before considering a production Dockerfile finished (the one that builds
the release image — not Dockerfile.test), scan it locally the same way the
EEA Jenkins Trivy stage will, so the first Jenkins run doesn't fail on a CVE
that could have been fixed or accepted up front. This mirrors the gate
described in the jenkins-pipeline skill's "EEA Trivy severity gate".
- Build the release image locally:
docker build -t <repo>-release:preflight . - Scan it for
CRITICALfindings — the same severity the Jenkins gate enforces:
Also run adocker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ aquasec/trivy:<pinned-version> image --no-progress --format table \ --severity CRITICAL <repo>-release:preflightHIGH,CRITICALpass so you see what will show up in the archived Jenkins report even though it won't gate the build — otherwiseHIGHfindings are a surprise the first time someone reads that report. - For each
CRITICALfinding, check theFixed Versioncolumn Trivy reports:- If a fixed version exists — a newer base image tag, or a pinnable
package/dependency version — update the Dockerfile (bump the base
image tag, pin the package to the fixed version, e.g.
apt-get install <pkg>=<fixed-version>), then rebuild and rescan. Repeat until no fixableCRITICALfinding remains. - If
Fixed Versionis blank (no patch published upstream yet, e.g. Trivy statusaffectedorfix_deferred), do not block on it or loosen the gate. Add it to.trivyignoreinstead, with a comment giving: the package/CVE, that no upstream fix exists as of the scan date, and whether the vulnerable package is even reachable from the application's own code (most OS/apt transitive dependencies are not).
- If a fixed version exists — a newer base image tag, or a pinnable
package/dependency version — update the Dockerfile (bump the base
image tag, pin the package to the fixed version, e.g.
- Never add a finding to
.trivyignorejust because a fix is inconvenient — only for confirmed no-fix-available cases, each with its own comment explaining why. Don't blanket-ignore an entire severity tier. - Clean up the local preflight image and any containers created for the
scan once done (
docker rmi <repo>-release:preflight,docker rm -v <name>for named scan containers) — this is a local-only check, not something to leave running or leave images behind for.
<!-- END EEA-OVERRIDES --><!-- Merged Build: upstream SKILL.md + EEA-OVERRIDES.md --><!-- Auto-generated by scripts/build.sh - DO NOT EDIT DIRECTLY --><!-- Source: https://github.com/eea/eea.agent.skills -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

