agentsclimarketplace

Dockerfile optimise

Skill ComeOnOliver/skillshub/skills/pproenca/dot-skills/dockerfile-optimise

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.From the repository description

Install
npx -y skills add ComeOnOliver/skillshub --skill dockerfile-optimise

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

6.6 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

Dockerfile Optimization Best Practices

Comprehensive Dockerfile optimization guide sourced exclusively from official Docker documentation. Contains 48 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new Dockerfiles or modifying existing ones
  • Optimizing Docker build times (layer caching, cache mounts, context management)
  • Reducing Docker image size (multi-stage builds, minimal base images)
  • Hardening container security (secret mounts, non-root users, attestations)
  • Setting up CI/CD pipelines with Docker builds
  • Reviewing Dockerfiles for anti-patterns

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Layer Caching & OrderingCRITICALcache-
2Multi-Stage BuildsCRITICALstage-
3Base Image SelectionHIGHbase-
4Build Context ManagementHIGHctx-
5Security & SecretsHIGHsec-
6Dependency ManagementMEDIUM-HIGHdep-
7Instruction PatternsMEDIUMinst-
8Quality & ValidationMEDIUMlint-

Quick Reference

1. Layer Caching & Ordering (CRITICAL)

2. Multi-Stage Builds (CRITICAL)

3. Base Image Selection (HIGH)

4. Build Context Management (HIGH)

5. Security & Secrets (HIGH)

6. Dependency Management (MEDIUM-HIGH)

7. Instruction Patterns (MEDIUM)

8. Quality & Validation (MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.