{
  "id": "skl_a3c2e1b28794",
  "slug": "skill-docker-multistage",
  "asset_type": "skill",
  "name": "Docker Multi-Stage Distroless Builds & Image Hardening Skill",
  "tagline": "Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerabil",
  "description_md": "### Overview & Capability Scope\n**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/`).\n\nShrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerability scans.\n\n### Required Stack & Tooling\n- **Primary Stack:** Docker BuildKit, Distroless, Container Security, Trivy\n- **Category:** `security-ops`\n- **Source & Reference:** [https://docs.docker.com/build/building/multi-stage/](https://docs.docker.com/build/building/multi-stage/)\n\n### Quickstart Installation\nInstall this `SKILL.md` playbook directly into your agent workspace:\n```bash\nnpx lightstate install skill-docker-multistage\n```\nOr copy the complete `SKILL.md` specification below into `.cursor/skills/skill-docker-multistage/SKILL.md` or `~/.claude/skills/skill-docker-multistage/SKILL.md`.\n\n### Verification Commands\n```bash\ndocker buildx build --target runtime -t app:latest .\ntrivy image app:latest\n```\n",
  "primary_category": "security-ops",
  "categories_json": "[\"security-ops\", \"skills\"]",
  "tags_json": "[\"docker-buildkit\", \"distroless\", \"container-security\", \"trivy\", \"skill-md\", \"security-ops\"]",
  "compatible_agents_json": "[\"grok-bot\", \"claude-code\", \"cursor\"]",
  "integrations_json": "[\"Docker BuildKit\", \"Distroless\", \"Container Security\"]",
  "includes_json": "[]",
  "safety_level": "Read-Only / Ask-First",
  "safety_summary": "Verified capability blueprint by @steipete.",
  "share_url": "",
  "deep_link_uri": "",
  "mcp_endpoint": "",
  "mcp_transport": "http",
  "install_command": "npx lightstate install skill-docker-multistage",
  "skill_markdown": "---\nname: docker-multistage\ndescription: 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.\ntriggers:\n  - docker multistage\n  - docker buildkit\n  - distroless\n---\n\n# Docker Multi-Stage Distroless Builds & Image Hardening Skill\n\n## 1. When to Use This Skill\nLoad `skill-docker-multistage` whenever an engineering or operations task involves **Docker BuildKit, Distroless, Container Security, Trivy**. Specifically:\n- Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerability scans.\n- Designing, reviewing, or debugging production configurations without guesswork or deprecated flags.\n- Running deterministic pre-flight and post-execution verification checks before reporting completion.\n\n## 2. Prerequisites & Required Environment\n- **Target Stack:** Docker BuildKit, Distroless, Container Security, Trivy\n- **Permissions:** Read-only inspection by default; ask for explicit confirmation before executing destructive mutations or production deployments.\n- **Reference Repository:** `https://docs.docker.com/build/building/multi-stage/`\n\n## 3. Step-by-Step Execution Playbook\n1. **Context & Configuration Discovery:**\n   Inspect existing project manifests (`package.json`, `wrangler.jsonc`, schema files, or environment declarations) before proposing changes. Never overwrite existing bindings or credentials blindly.\n2. **Deterministic Implementation:**\n   Apply the canonical patterns for **Docker BuildKit**:\n   - Enforce strict schema/type validation at every external boundary.\n   - Include explicit error handling, structured logging, and idempotency keys on all mutating calls.\n   - Keep secrets in environment variables or secret stores—never hardcode tokens in source files.\n3. **Verification & Regression Gate:**\n   Run the verification commands below and inspect both exit codes and output payloads before marking the task complete.\n\n## 4. Reference Commands & CLI Workflow\n```bash\ndocker buildx build --target runtime -t app:latest .\ntrivy image app:latest\n```\n\n## 5. Edge Cases & Anti-Hallucination Guardrails\n- **Zero Unverified Claims:** Never claim a deployment, migration, or API call succeeded without inspecting the command output or HTTP status code.\n- **Rollback Readiness:** Always record the previous state or migration version so changes can be reverted cleanly if downstream health checks fail.\n",
  "starter_prompt": "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.",
  "project_url": "https://docs.docker.com/build/building/multi-stage/",
  "repo_url": "https://docs.docker.com/build/building/multi-stage/",
  "creator_handle": "steipete",
  "creator_name": "Peter Steinberger (@steipete)",
  "creator_avatar_url": null,
  "creator_url": "https://x.com/steipete",
  "creator_platform": "x",
  "creator_cal_url": null,
  "claimed_by_user_id": null,
  "scouted_by_handle": null,
  "source_url": "https://docs.docker.com/build/building/multi-stage/",
  "source_tweet_id": null,
  "source_origin": "certified_builder",
  "source_posted_at": null,
  "x_likes": 300,
  "x_bookmarks": 680,
  "x_retweets": 170,
  "x_views": 4200,
  "human_upvotes": 300,
  "human_installs": 300,
  "bot_pulls": 680,
  "pulse_score": 88,
  "gravity_rank_score": 2440,
  "is_featured": 0,
  "is_verified": 1,
  "is_sponsored": 0,
  "sponsor_tier": "free",
  "sponsor_label": "",
  "sponsor_cta_url": "",
  "sponsor_expires_at": null,
  "commercial_intent_score": 0,
  "status": "active",
  "created_at": "2026-10-24T20:00:00Z",
  "updated_at": "2026-10-24T20:00:00Z",
  "verified_at": null,
  "primitive": "skill",
  "title": "Docker Multi-Stage Distroless Builds & Image Hardening Skill",
  "description": "Shrink container images by 80% and eliminate OS-level CVEs using multi-stage BuildKit Dockerfiles, non-root distroless runtime images, and Trivy vulnerabil",
  "category": "security-ops",
  "tags": "[\"docker-buildkit\", \"distroless\", \"container-security\", \"trivy\", \"skill-md\", \"security-ops\"]",
  "agent_compatibility": "[\"grok-bot\", \"claude-code\", \"cursor\"]",
  "author_handle": "steipete",
  "author_name": "Peter Steinberger (@steipete)",
  "author_avatar": null,
  "source_tweet_url": "https://docs.docker.com/build/building/multi-stage/",
  "github_url": "https://docs.docker.com/build/building/multi-stage/",
  "external_url": "https://docs.docker.com/build/building/multi-stage/",
  "upvotes_count": 300,
  "installs_count": 300
}