docker-expert

Optimizes Dockerfiles, hardens container security, and configures Docker Compose orchestration.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill docker-expert-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-expert
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/docker-expert
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill docker-expert-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Container configurations often suffer from bloated images, security vulnerabilities, slow builds, and fragile orchestration setups. This Skill diagnoses and fixes Dockerfile, image, and Docker Compose issues using production-grade patterns. ## 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 security scans. Invoke this Skill to refactor it into a hardened multi-stage build under 200MB with a non-root user and health checks. ## Quick Start Use the docker-expert skill to review my Dockerfile and reduce the production image size while fixing 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 stage. Combining this with distroless or Alpine base images and cleaning package manager caches in the same RUN layer significantly shrinks images.

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. Also copy files with --chown so the application user owns its working directory.

Does Docker Compose support service health checks and startup ordering?

Yes, Compose supports healthcheck blocks with test commands, intervals, and retries. Use depends_on with condition: service_healthy to enforce startup ordering so dependent services wait until dependencies are ready.

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.

When should I use Kubernetes instead of Docker Compose?

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