writing-dockerfiles

Generate production-ready Dockerfiles with multi-stage builds and BuildKit caches.

9|2|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/hongmaple0820/agent-academy --skill writing-dockerfiles-hongmaple0820
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-dockerfiles
Source: https://github.com/hongmaple0820/agent-academy/tree/main/skills/development/writing-dockerfiles
Command: npx skills add https://github.com/hongmaple0820/agent-academy --skill writing-dockerfiles-hongmaple0820

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing consistent, secure, and efficient Dockerfiles is error-prone and time-consuming; this Skill provides a framework to write repeatable, production-grade Dockerfiles using multi-stage builds, BuildKit caches, and security best practices.

Core Features & Use Cases

  • Multi-stage Dockerfile patterns for Python, Node.js, Go, Rust, and Java to minimize final image size.
  • BuildKit-enabled optimizations (cache mounts, secret mounts, parallel stages) for faster, safer builds.
  • Security hardening through non-root execution and distroless/base runtime patterns.

Quick Start

Create a production-ready Dockerfile for your project by following the patterns outlined in this Skill and adapt them to your language stack.

Frequently Asked Questions about writing-dockerfiles

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

FAQPage Schema
How do I create a minimal Dockerfile using multi-stage builds?

Multi-stage builds minimize final Docker image size by copying only compiled artifacts from builder stages to a minimal runtime base. This Skill generates language-specific multi-stage patterns for Python, Node.js, Go, Rust, and Java to produce production-ready images.

What's the best way to use BuildKit cache mounts to speed up Docker builds?

BuildKit cache mounts accelerate Docker builds by persisting package manager directories across runs. This Skill implements BuildKit-enabled optimizations including cache mounts, secret mounts, and parallel stages for faster, safer CI/CD pipeline integration.

How do I run a Docker container as a non-root user for security hardening?

Non-root execution hardens Docker security by preventing privilege escalation attacks inside the container. This Skill applies security hardening patterns using distroless base images and non-root users to create secure, production-grade containers.

Does this Dockerfile Skill support specific patterns for Python and Node.js?

Yes, this Skill applies language-specific Dockerfile patterns for Python, Node.js, Go, Rust, and Java. It covers base image choices, cache strategies, and security hardening tailored to each language stack's deployment context.

Can I integrate these Dockerfile strategies directly into my CI/CD pipeline?

Yes, this Skill returns reusable Dockerfile strategies, snippet examples, and integration notes specifically suitable for CI/CD pipelines. It provides production-ready patterns that standardize container builds across automated deployment workflows.

Why are my Docker images so large and how can distroless images help?

Distroless images reduce Docker image size by removing package managers, shells, and unnecessary OS utilities from the final runtime layer. This Skill uses distroless and minimal base runtime patterns to craft secure, minimal Dockerfiles.