Docker Skill

Optimizes Docker container builds with multi-stage patterns and security configurations.

370|33|Updated Dec 14, 2025
One-click install
npx skills add https://github.com/nth5693/gemini-kit --skill docker-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Docker Skill
Source: https://github.com/nth5693/gemini-kit/tree/main/skills/docker
Command: npx skills add https://github.com/nth5693/gemini-kit --skill docker-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams optimize container builds, enforce Docker best practices, and produce smaller, more secure production images by providing ready-to-use patterns for multi-stage builds, ignore rules, and deployment configurations.

Core Features & Use Cases

  • Multi-stage builds: reduce image size by separating build and runtime stages.
  • Security & non-root runs: configure non-root users and minimal privileges.
  • Operational patterns: healthchecks, cache-efficient layers, and ignore rules for smaller images.
  • Use Case: If you have a Node.js app, apply these patterns to produce a lean production image and a reliable deployment.

Quick Start

Create a multi-stage Dockerfile and a docker-compose.yml following the examples above, then build and run your project with docker build -t my-app . and docker run -p 3000:3000 my-app.

Frequently Asked Questions about Docker Skill

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

FAQPage Schema
How do I optimize Docker builds for smaller and more secure production images?

To optimize Docker builds, use multi-stage builds to separate build and runtime stages, enforce non-root user configurations, and apply .dockerignore rules to reduce image size and tighten security.

What is a multi-stage build in Docker and when do I need it?

A multi-stage build is a Docker pattern that separates the build environment from the runtime environment to reduce final image size. You need it when compiling code that requires heavy dependencies not needed in production.

How do I configure healthchecks and non-root users in a Dockerfile?

Configure healthchecks and non-root users in a Dockerfile by adding healthcheck instructions to monitor container status and creating a non-root user with minimal privileges to run the application securely.

Do I need Docker installed to apply these container best practices?

Yes, you need Docker installed and configured on your system to build and run images. These best practices require executing build commands like docker build and running containers locally to verify configurations.

What's the best way to structure Docker layers for cache efficiency?

The best way to structure Docker layers for cache efficiency is ordering instructions from least to most frequently changing, copying package files before source code, and leveraging ignore rules to exclude unnecessary files.

Why does my production Docker image contain build dependencies and unnecessary files?

Your production Docker image contains build dependencies because it lacks multi-stage build separation and .dockerignore rules. Applying these patterns isolates runtime requirements and excludes unnecessary files from the build context.