dockerfile

Generate secure multi-stage Dockerfiles for containerizing applications.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/rigerc/ha-apps --skill dockerfile-rigerc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dockerfile
Source: https://github.com/rigerc/ha-apps/tree/main/.claude/skills/dockerfile
Command: npx skills add https://github.com/rigerc/ha-apps --skill dockerfile-rigerc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generating Dockerfiles that are secure, efficient, and production-ready for containerizing applications.

Core Features & Use Cases

  • Multi-stage builds to minimize final image size and attack surface.
  • Thoughtful base image selection and minimal layer usage for optimal runtime efficiency.
  • Proper ARG/ENV handling, WORKDIR placement, and correct CMD/ENTRYPOINT usage, with HEALTHCHECK and EXPOSE where appropriate.
  • Use Case: Create a Dockerfile for a Node.js app that builds in a stage and runs on a slim runtime image.

Quick Start

Use this skill to generate a Dockerfile for a Node.js application that builds with a multi-stage process and produces a minimal runtime image.

Frequently Asked Questions about dockerfile

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

FAQPage Schema
How do I create a production-ready Dockerfile for a Node.js application?

A production-ready Dockerfile uses multi-stage builds to separate the build environment from the final runtime image, minimizing size and attack surface. It enforces best practices for base image selection, layer ordering, and proper ENTRYPOINT configuration.

What is the best way to minimize Docker image size using multi-stage builds?

The best way to minimize Docker image size is implementing multi-stage builds, which compile dependencies in an intermediate stage and copy only essential runtime artifacts to a slim base image. This approach discards build tools and reduces the final image footprint.

How should I handle ARG and ENV variables in a Dockerfile to optimize build cache?

Handle ARG and ENV variables by declaring them after static layers like WORKDIR and package installations to optimize build cache. This ensures frequently changing environment variables invalidate only subsequent layers, preserving cached dependencies and speeding up builds.

Does my Dockerfile need a HEALTHCHECK instruction for production readiness?

Yes, adding a HEALTHCHECK instruction to your Dockerfile improves production readiness by allowing Docker to monitor container health and automatically restart unhealthy instances. It should be included alongside proper EXPOSE and CMD or ENTRYPOINT configurations.

When should I refactor an existing Dockerfile for containerization?

You should refactor an existing Dockerfile when your container image is too large, build times are slow, or security vulnerabilities are present. Refactoring implements multi-stage builds, optimizes layer caching, and enforces minimal base image selection for production readiness.