Writing optimized, secure, multi-stage Dockerfiles with language-specific patterns (Python, Node.js, Go, Rust), BuildKit features, and distroless images.
SkillScore95Maintained
Automatic
◆DevOps & SRE pack
Last verified 8/21/2026
What it changes
Passed 21 of 22 test cases with the skill, and 15 of 22 without it.
Without skill68%
With skill95%
Checks it passed that the model alone missed
Sets USER nonroot:nonroot
Uses --mount=type=secret,id=github_token in the RUN instruction
Uses gcr.io/distroless/static-debian12 as the runtime base image
and 6 more in the full report
6 fixed15 passed either way1 still failing0 broke
Pass-rate lift
+27 pp
Tokens
+181%
Agent turns
0%
Response time
-10%
Model gemini-3.6-flashMeasured 8/21/2026v121 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 6
Prompt
When using Google Distroless runtime images like gcr.io/distroless/base-debian12, which pre-existing non-root user account should be declared in the USER instruction?
What was checked, without and with the skill
Checked
Without skill
With skill
Sets USER nonroot:nonroot
Missed
Passed
case-15 · gemini-3.6-flash · 8/21/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md467 lines11 filesincludes scripts
Writing Dockerfiles
Create production-grade Dockerfiles with multi-stage builds, security hardening, and language-specific optimizations.
When to Use This Skill
Invoke when:
"Write a Dockerfile for [Python/Node.js/Go/Rust] application"
"Optimize this Dockerfile to reduce image size"
"Use multi-stage build for..."
"Secure Dockerfile with non-root user"
"Use distroless base image"
"Add BuildKit cache mounts"
"Prevent secrets from leaking in Docker layers"
Quick Decision Framework
Ask three questions to determine the approach:
1. What language?
Python → See references/python-dockerfiles.md
Node.js → See references/nodejs-dockerfiles.md
Go → See references/go-dockerfiles.md
Rust → See references/rust-dockerfiles.md
Java → See references/java-dockerfiles.md
2. Is security critical?
YES → Use distroless runtime images (see references/security-hardening.md)