docker

Optimize Dockerfiles and docker-compose configurations for reproducible, minimal, and secure container images.

4|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/rbaumier/skills --skill docker-rbaumier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker
Source: https://github.com/rbaumier/skills/tree/main/docker
Command: npx skills add https://github.com/rbaumier/skills --skill docker-rbaumier

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides concrete, actionable guidance to author reproducible, minimal, and secure container images and docker-compose stacks, reducing build churn, security risk, and runtime surprises.

Core Features & Use Cases

  • Multi-stage build patterns: Prescribe deps, build, dev, and production stages to keep build tools out of final images.
  • Layer and cache optimization: Order layers, copy lockfiles first, and use cache mounts for faster and deterministic builds.
  • Compose and runtime patterns: Recommend anonymous volumes for node_modules, healthchecks, depends_on readiness, and binding dev ports to localhost.
  • Security hardening: Pin base images, run as non-root, avoid baking secrets, add no-new-privileges, drop capabilities, and use read-only filesystems with tmpfs for writable paths.
  • Networking, volumes, and observability: Guidance for service discovery, named volumes, resource limits, OCI labels, and signal handling with tini.
  • Debugging & maintenance: Common commands and workflows for logs, shelling into containers, network checks, and safe cleanup.

Quick Start

Ask the docker skill to convert a single-stage Dockerfile and compose file into a multi-stage, production-ready setup that pins base images, adds healthchecks, creates a non-root user, uses cache mounts, and moves secrets to env_file.

Frequently Asked Questions about docker

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

FAQPage Schema
How do I optimize Dockerfiles for minimal and secure container images?

Secure your docker-compose configuration by binding dev ports to localhost, using env_file for secrets, adding no-new-privileges, dropping capabilities, and applying read-only filesystems with tmpfs for writable paths.

Why does my docker-compose setup fail service discovery and container networking checks?

Use Docker cache mounts by copying lockfiles first and leveraging BuildKit cache mounts for dependencies. This ordering prevents invalidating cached layers when source code changes, ensuring faster and deterministic image builds.

What's the best way to handle node_modules and persistent volumes in docker-compose development?

Handle node_modules in development by using anonymous volumes to prevent host overrides and named volumes for persistent application data. This isolates dev dependencies and ensures data survives container recreation without manual volume management.

Do I need tini and OCI labels when building production-ready Docker containers?

You need tini for proper signal handling and OCI labels for container metadata in production. Combined with resource limits and safe cleanup workflows, these configurations ensure observable, maintainable, and production-ready Docker container deployments.