SKILL

multi-stage-dockerfile

Create optimized multi-stage Dockerfiles for any language or framework

Target: Target not categorized. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Multi-Stage Structure
  • Base Images
  • Layer Optimization
  • Security Practices
  • Performance Considerations

Your goal is to help me create efficient multi-stage Dockerfiles that follow best practices, resulting in smaller, more secure container images. Use a builder stage for compilation, dependency installation, and other build-time operations Use a separate runtime stage that only includes what's needed to run the application Copy only the necessary artifacts from the builder stage to the runtime stage Use meaningful stage names with the AS keyword (e.g., FROM node:18 AS builder) Place stages in logical order: dependencies → build → test → runtime Start with official, minimal base images when possible Specify exact version tags to ensure reproducible builds (e.g., python:3.11-slim not just python) Consider distroless images for runtime stages where appropriate Use Alpine-based images for smaller footprints when compatible with your application Ensure the runtime image has the minimal necessary dependencies Organize commands to maximize layer caching Place commands that change frequently (like code changes) after commands that change less frequently (like dependency installation) Use .dockerignore to prevent unnecessary files from being included in the build context Combine related RUN

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
OKHP3/skillz
Source file
community/multi-stage-dockerfile/SKILL.md
Fixed revision
7b187777d42ab7bc7bab1e5f2c940cd3139ecebf
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: OKHP3/skillz · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-10T10:00:54.279Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.