docker-expert

Diagnoses and optimizes Dockerfiles, container security, and Docker Compose orchestration configurations.

1|Updated May 10, 2026
One-click install
npx skills add https://github.com/Tgoldi/claude-skills --skill docker-expert-tgoldi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-expert
Source: https://github.com/Tgoldi/claude-skills/tree/main/docker-expert
Command: npx skills add https://github.com/Tgoldi/claude-skills --skill docker-expert-tgoldi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Container configurations often suffer from bloated images, security vulnerabilities, slow builds, and broken orchestration. This Skill provides expert-level Docker analysis to fix Dockerfile inefficiencies, harden container security, and produce production-ready Compose setups. ## Core Features & Use Cases - Dockerfile Optimization: Applies multi-stage builds, layer caching strategies, and base image selection (Alpine, distroless, scratch) to minimize image size and build time. - Security Hardening: Configures non-root users, secrets management via BuildKit and Docker secrets, and minimal attack surfaces. - Compose Orchestration: Designs service dependencies with health checks, custom networks, resource limits, and environment-specific overrides. - Use Case: Your Node.js production image is 1.2GB and fails a security scan. Invoke this Skill to refactor the Dockerfile into a multi-stage distroless build with a non-root user, cutting the image to under 200MB and passing vulnerability checks. ## Quick Start Use the docker-expert skill to review my Dockerfile and docker-compose.yml, then optimize the image size and fix any security issues.

Frequently Asked Questions about docker-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce Docker image size with multi-stage builds?

Multi-stage builds separate dependency installation, compilation, and runtime into distinct stages, copying only necessary artifacts into the final image. Combining this with distroless or Alpine base images and cleaning package manager caches in the same RUN layer can reduce images from over 1GB to under 200MB.

How to run Docker containers as a non-root user?

Create a dedicated user with a specific UID/GID using addgroup and adduser, then set the USER directive before CMD. Copy files with --chown so the runtime user owns application files, and avoid running any process as root inside the container.

What is the difference between Alpine and distroless base images?

Alpine is a minimal Linux distribution with a shell and package manager, useful when you need debugging tools. Distroless images contain only the runtime and its dependencies with no shell, offering a smaller attack surface but harder troubleshooting.

Why is my Docker build so slow and how do I fix it?

Slow builds usually come from poor layer ordering, large build contexts, or missing cache strategy. Copy dependency manifests before source code, add a comprehensive .dockerignore, and use BuildKit cache mounts for package managers to preserve caches between builds.

How do I manage secrets in Docker Compose securely?

Use the secrets top-level element in Compose with external or file-backed secrets mounted under /run/secrets, referencing them via _FILE environment variables. Never place secrets in ENV variables or image layers, since they persist in image history.

When should I use Kubernetes instead of Docker Compose?

Docker Compose suits single-host development and small deployments, while Kubernetes is needed for multi-host orchestration, autoscaling, and advanced service discovery. This Skill handles Docker and Compose; Kubernetes pod and ingress work should go to a Kubernetes-focused expert.