⚡ Pulse Score 88/100
Docker Multi-Stage Distroless Builds & Image Hardening Skill
Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerabil
⚡ 1-Click Agent & Developer Install
Zero Auth · Ready for Grok Bot, Claude Code & Cursornpx lightstate install skill-docker-multistage
Copy-Paste System Prompt / Routine Blueprint:
Load the Docker Multi-Stage Distroless Builds & Image Hardening Skill (skill-docker-multistage) playbook. First inspect our current configuration and codebase for Docker BuildKit, Distroless, Container Security, Trivy. Then propose a concrete, step-by-step implementation plan following the skill-docker-multistage guardrails, run the non-destructive verification commands (docker buildx build --target runtime -t app:latest .), and summarize any findings, risks, or required environment variables before making production changes.
📘 Complete SKILL.md Playbook Specification
--- name: docker-multistage description: Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerability scans. Use when working with Docker BuildKit, Distroless, Container Security, Trivy. triggers: - docker multistage - docker buildkit - distroless --- # Docker Multi-Stage Distroless Builds & Image Hardening Skill ## 1. When to Use This Skill Load `skill-docker-multistage` whenever an engineering or operations task involves **Docker BuildKit, Distroless, Container Security, Trivy**. Specifically: - Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerability scans. - Designing, reviewing, or debugging production configurations without guesswork or deprecated flags. - Running deterministic pre-flight and post-execution verification checks before reporting completion. ## 2. Prerequisites & Required Environment - **Target Stack:** Docker BuildKit, Distroless, Container Security, Trivy - **Permissions:** Read-only inspection by default; ask for explicit confirmation before executing destructive mutations or production deployments. - **Reference Repository:** `https://docs.docker.com/build/building/multi-stage/` ## 3. Step-by-Step Execution Playbook 1. **Context & Configuration Discovery:** Inspect existing project manifests (`package.json`, `wrangler.jsonc`, schema files, or environment declarations) before proposing changes. Never overwrite existing bindings or credentials blindly. 2. **Deterministic Implementation:** Apply the canonical patterns for **Docker BuildKit**: - Enforce strict schema/type validation at every external boundary. - Include explicit error handling, structured logging, and idempotency keys on all mutating calls. - Keep secrets in environment variables or secret stores—never hardcode tokens in source files. 3. **Verification & Regression Gate:** Run the verification commands below and inspect both exit codes and output payloads before marking the task complete. ## 4. Reference Commands & CLI Workflow ```bash docker buildx build --target runtime -t app:latest . trivy image app:latest ``` ## 5. Edge Cases & Anti-Hallucination Guardrails - **Zero Unverified Claims:** Never claim a deployment, migration, or API call succeeded without inspecting the command output or HTTP status code. - **Rollback Readiness:** Always record the previous state or migration version so changes can be reverted cleanly if downstream health checks fail.
Synthesized Engineering Blueprint & Setup Guide
### Overview & Capability Scope
**Docker Multi-Stage Distroless Builds & Image Hardening Skill** (`skill-docker-multistage`) is a verified, portable `SKILL.md` playbook curated with **@steipete** for Grok Bot (`x.ai/bot/`), Claude Code (`~/.claude/skills/`), and Cursor (`.cursor/skills/`).
Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerability scans.
### Required Stack & Tooling
- **Primary Stack:** Docker BuildKit, Distroless, Container Security, Trivy
- **Category:** `security-ops`
- **Source & Reference:** [https://docs.docker.com/build/building/multi-stage/](https://docs.docker.com/build/building/multi-stage/)
### Quickstart Installation
Install this `SKILL.md` playbook directly into your agent workspace:
```bash
npx lightstate install skill-docker-multistage
```
Or copy the complete `SKILL.md` specification below into `.cursor/skills/skill-docker-multistage/SKILL.md` or `~/.claude/skills/skill-docker-multistage/SKILL.md`.
### Verification Commands
```bash
docker buildx build --target runtime -t app:latest .
trivy image app:latest
```
Tags: #docker-buildkit#distroless#container-security#trivy#skill-md#security-ops
✓ CERTIFIED X BUILDER PORTFOLIO
More Capabilities Curated from @steipete
Related Verified Capabilities
Explore Security & Infra → Agent Skill
⚡ 94
Agent Skill
⚡ 93
Wrangler CLI Deployment & Resource Management Playbook
Agent Skill
⚡ 92
Cloudflare D1 SQLite Schema & Zero-Downtime Migrations Skill
Agent Skill
⚡ 91
Cloudflare R2 Object Storage & Presigned URL Pipeline Skill
Agent Skill
⚡ 90
Cloudflare Durable Objects Stateful Coordination Playbook
Agent Skill
⚡ 89