·
Last changedVersion:
No hardening report available.
Your goal is to help me create efficient multi-stage Dockerfiles that follow best practices, resulting in smaller, more secure container images.
AS keyword (e.g., FROM node:18 AS builder — replace node:18 with a digest-pinned reference in production)python:3.11-slim not just python),
but pin base images by immutable digest for production and CI builds:
Tags are mutable and can be silently repointed. To obtain the digest:
Use tools such as crane digest or Renovate's digest pinning to keep digests current..dockerignore to prevent unnecessary files from being included in the build context&& to reduce layer countUSER instruction to specify a non-root userARG or ENV — values persist in image layer history and are visible via docker history. Use BuildKit secret mounts for any credential needed only at build time:
Invoke with: docker build --secret id=token,src=./token.txt .ARG) only for non-secret configuration that varies between environments (e.g., target architecture, version numbers). ARG values are stored in image layer history and are visible via docker history — never pass tokens, passwords, or API keys as build arguments (see Security Practices for the correct alternative).Need this version hardened?
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
—
—
MIT
HARDENING.md
LICENSE
SKILL.md