---
name: "distroless-minimal-base-images"
description: "Eliminate package managers, shells, and system utilities from production runtime containers."
metadata:
  author: "Google Container Tools"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "use distroless base image"
  - "reduce cve with distroless"
  - "run nodejs distroless container"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Google Distroless Minimal Base Images & Vulnerability Reduction

Hardens container images with Google Distroless: migrating Node.js, Go, Python, and Java apps to distroless bases (gcr.io/distroless/static, cc, nodejs), reducing attack surface, and eliminating CVE vulnerabilities.

## When to Invoke
Invoke this skill whenever you need to:
- use distroless base image
- reduce cve with distroless
- run nodejs distroless container

## Execution SOP & Rules
1. Compile application binary in builder stage with statically linked libraries.
2. Set final stage: FROM gcr.io/distroless/static-debian12:nonroot.
3. Copy compiled binary and assets into place and define ENTRYPOINT ['/app/server'].
4. Verify container cannot execute arbitrary shell commands: docker run --rm <image> sh will fail safely.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
