Multi-Stage Dockerfile Skill for Claude Code: Smaller, Safer Images
Makes your assistant write multi-stage Dockerfiles with a build stage, a slim runtime stage, pinned base images and a non-root user.
- Installs
- 30.9K
- on skills.sh
- Stars
- 40.7K
- on GitHub
- Updated
- Oct 2026
- last repo commit
This skill is a one-page checklist for Dockerfiles. It tells your assistant to split the build into stages, copy only what the runtime needs, pin exact base image tags and run as a non-root user.
It has five sections: stage structure, base images, layer optimization, security and performance. It bundles no scripts and does not say how to trigger itself, so ask for a Dockerfile and mention the skill.
Good for
- Developers who want a Dockerfile for a new service in any language
- Teams trimming image size and build time
- Anyone asked to harden a container image
Install multi-stage-dockerfile
Claude Code
- 1
Copy this prompt.
Install the multi-stage-dockerfile skill in Claude Code. Run this command: npx skills add https://github.com/github/awesome-copilot --skill multi-stage-dockerfile Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Create optimized multi-stage Dockerfiles for any language or framework
Sections in SKILL.md
- Multi-Stage Structure
- Base Images
- Layer Optimization
- Security Practices
- Performance Considerations
Key facts
- Installs on skills.sh
- 30,895 (Nov 2, 2026)
- GitHub stars
- 40,666 for the whole repo (Nov 2, 2026)
- What installs
- 1 file (SKILL.md), no scripts
- Collection note
- The README says customizations in the repo come from third-party developers and should be inspected before installing
- Other install route
- The skills list shows gh skills install github/awesome-copilot multi-stage-dockerfile
- Last commit
- Oct 30, 2026 (repo)
What it includes
Builder stage plus a separate runtime stage
Use a builder stage for compiling and dependencies, a runtime stage with only what runs, named stages with AS, and the order dependencies, build, test, runtime. Copy only needed artifacts between stages.
Try: “Write a multi-stage Dockerfile for my Node API.”
Multi-stage structureMinimal official images with exact version tags
Pin tags such as python:3.11-slim, consider distroless for runtime, and use Alpine when it suits your app.
Base imagesOrder commands for caching and keep the context small
Put frequently changing steps after rarely changing ones, use .dockerignore, combine related RUN commands with &&, and consider COPY --chown.
Layer optimizationNon-root user, no build tools in the final image, scan the image
Use USER, remove build tools and extra packages, scan the final image, set restrictive file permissions and keep build secrets out of the final image.
Security practicesBuild args, cache order, NODE_ENV and HEALTHCHECK
Use build arguments for per-environment settings, order layers for cache hits, set variables like NODE_ENV=production and add a HEALTHCHECK suited to the app.
Performance considerations
From the official docs
Questions
What does the multi-stage-dockerfile skill do?
It gives your assistant a checklist for writing multi-stage Dockerfiles: separate build and runtime stages, pinned minimal base images, cache-friendly layer order, a non-root user and a health check.
How do I install it?
Use the install box above. The repo's skills list also shows a GitHub CLI route, gh skills install github/awesome-copilot multi-stage-dockerfile.
How do I trigger it?
The skill gives only a short description and no trigger rules. Ask for a multi-stage Dockerfile and name the skill if your assistant does not pick it up on its own.
Does it work for any language?
Its description says any language or framework, and the examples mention Node and Python images. The advice is general, so check the result against your stack's build steps.
Does it run Docker or scan images?
No scripts are bundled. It lists scanning the final image as advice, but the skill names no scanner, so tell your assistant which one to use.
Is it safe?
It is one text file with no scripts. The awesome-copilot README says its contents come from third-party developers, so read the file before you install it. The advice itself is to avoid running as root and to keep secrets out of the final image.
Is it from GitHub?
It lives in GitHub's awesome-copilot repo, which is a community collection and carries GitHub's copyright in its MIT license. The README says individual items come from third-party developers.
Information
updated Nov 2, 2026
- Repository
- github/awesome-copilot
- Folder
skills/multi-stage-dockerfile
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- multi-stage-dockerfile SKILL.md · github.com
- awesome-copilot skills list · github.com
- awesome-copilot LICENSE · github.com
- awesome-copilot README · github.com
- multi-stage-dockerfile on skills.sh · skills.sh