Agent skill

Dockerfile Optimise

by pproenca in pproenca/dot-skills

Dockerfile optimization guidelines from official Docker documentation.

MITAuto-check passedDevOps & Cloud

Install Dockerfile Optimise

skills CLI
$ npx skills add pproenca/dot-skills --skill dockerfile-optimise -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pproenca/dot-skills dockerfile-optimise --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pproenca/dot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.experimental/dockerfile-optimise .claude/skills/dockerfile-optimise && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dockerfile-optimise
GitHub stars
214
Token cost
~1.8k tokens
SKILL.md length
528 words
Files
51 (incl. references, assets)
Skills in repo
182
Repo updated
First seen
Licence
MIT

At a glance

Dockerfile optimization guidelines from official Docker documentation.

  • Works in 8 steps: Layer Caching & Ordering (CRITICAL) → Multi-Stage Builds (CRITICAL) → Base Image Selection (HIGH) → …
  • Tasks involving Dockerfile creation
  • SKILL.md covers When to Apply, Rule Categories by Priority, Quick Reference and How to Use, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Dockerfile Optimise is an agent skill from pproenca/dot-skills. Dockerfile optimization guidelines from official Docker documentation. This skill should be used when writing, reviewing, or refactoring Dockerfiles to ensure optimal build time, image size, security, and robustness. Triggers on tasks involving Dockerfile creation, Docker image builds, container optimization, multi-stage builds, build cache, or Docker security hardening.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 53 other files, including reference files and assets (for example `assets/templates/_template.md`, `metadata.json` and `references/_sections.md`).

It sits in DevOps & Cloud, covering Containers. It works with Docker. The repository describes itself as: A collection of AI agent skills following the Agent Skills open format. The licence is MIT.

When your agent uses it

  • Tasks involving Dockerfile creation
  • Docker image builds
  • Container optimization
  • Multi-stage builds

Example prompts

  • “/dockerfile-optimise”

Requirements

  • Docker

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  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)

What it can do on your machine

Read from SKILL.md and the folder at commit cf93c57. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dockerfile Optimise loads about 1.8k tokens when it runs, and up to ~37k if it reads all its reference files. Until then it costs about 98 tokens; SKILL.md has 528 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~98
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~37k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pproenca/dot-skills at commit cf93c57, republished under its MIT licence (© pproenca). 528 words, ~1,807 tokens.

Download SKILL.mdSave it as .claude/skills/dockerfile-optimise/SKILL.md (or your agent's skills folder). This skill also uses 50 other files; get the full folder from GitHub.
name
dockerfile-optimise
description
Dockerfile optimization guidelines from official Docker documentation. This skill should be used when writing, reviewing, or refactoring Dockerfiles to ensure optimal build time, image size, security, and robustness. Triggers on tasks involving Dockerfile creation, Docker image builds, container optimization, multi-stage builds, build cache, or Docker security hardening.

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)
Show full SKILL.md (210 more words)Show less
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

© pproenca, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 50 other files (references, assets) in skills/.experimental/dockerfile-optimise of pproenca/dot-skills.

  • SKILL.md
  • assets/templates/_template.md
  • metadata.json
  • references/_sections.md
  • references/base-arg-version.md
  • references/base-distroless.md
  • references/base-minimal-image.md
  • references/base-official-images.md
  • references/base-pin-versions.md
  • references/base-rebuild-regularly.md
  • references/cache-apt-combine.md
  • references/cache-copy-deps-first.md
  • references/cache-copy-link.md
  • references/cache-external.md
  • references/cache-invalidation.md
  • references/cache-layer-order.md
  • references/cache-minimize-layers.md
  • references/cache-mount-package.md
  • … and 33 more

Open the folder on GitHubat commit cf93c57

Compare with similar skills

Dockerfile Optimise next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dockerfile Optimise compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dockerfile Optimise this skillpproenca/dot-skills214—~1.8kAutomated safety check: PassMIT
Iron Proxy Gateway for NanoClawnanocoai/nanoclaw31k—~4.6kAutomated safety check: NotesMIT
GreptimeDB Dev Docker ImageGreptimeTeam/greptimedb6.7k—~4kAutomated safety check: NotesApache-2.0
Senior DevOps Toolkitmaslennikov-ig/claude-code-orchestrator-kit2596 repos~1.1kAutomated safety check: NotesCustom licence
LangBot Deployment Guidelangbot-app/LangBot18k—~1.2kAutomated safety check: NotesApache-2.0
Build Openshell Mxc WindowsNVIDIA/OpenShell15k—~4.9kAutomated safety check: PassApache-2.0

Similar skills

  • Installs or refreshes Iron Proxy and its Iron Control web console for NanoClaw, with a local Docker setup, database, credentials and a human approval bridge.

    31k GitHub stars~4.6k tokensUpdated yesterday
    DevOps & CloudAuto-check: notes
  • GreptimeDB Dev Docker Image

    GreptimeTeam/greptimedb

    Packages a locally built GreptimeDB debug binary into a development-only Docker image for local-cluster testing, with an optional push to a dev registry.

    6.7k GitHub stars~4k tokensUpdated 2 days ago
    DevOps & CloudAuto-check: notes
  • Senior DevOps Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…

    259 GitHub starsUsed in 6 repos~1.1k tokens
    DevOps & CloudAuto-check: notes
  • LangBot Deployment Guide

    langbot-app/LangBot

    Deploys and configures a LangBot instance with Docker Compose or Kubernetes, covering config.yaml, the Box sandbox runtime, the plugin runtime and the global API key.

    18k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Official

    Maintain and validate OpenShell's build-only Windows MSVC lane for x64 and ARM64.

    15k GitHub stars~4.9k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Omnigent Docker Compose Deploy

    omnigent-ai/omnigent

    Brings up the Omnigent server and Postgres as a Docker compose stack on any Docker host, and covers the Dockerfile's runtime and host build targets for extending it to a new platform.

    11k GitHub stars~1.3k tokensUpdated today
    DevOps & CloudAuto-check: notes

More from pproenca/dot-skills

All 182 skills in this repo
  • Audio Voice Recovery

    pproenca/dot-skills

    Audio forensics and voice recovery guidelines for CSI-level audio analysis.

    214 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Codemod React Pipeline

    pproenca/dot-skills

    Guided, scripted pipeline for running JSX/TSX/React codemods safely across large legacy codebases.

    214 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    214 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Dx Harness

    pproenca/dot-skills

    Developer-experience friction auditing and fixing — slow onboarding, repeated manual setup steps, missing bootstrap/reset/seed scripts, undiscoverable conventions.

    214 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Language Spec Author

    pproenca/dot-skills

    Turn a rough idea for a language into a complete, implementable specification — a DSL, query, config/data, template, or protocol language — by interviewing the author dimension by dimension until…

    214 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Python Pep Author

    pproenca/dot-skills

    Drafting Python Enhancement Proposals (PEPs) — proposing a Python language feature, a standard library change, an interoperability standard, or an informational/process document for the Python…

    214 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Dockerfile Optimise

What does Dockerfile Optimise do?

Dockerfile optimization guidelines from official Docker documentation. Dockerfile Optimise is an agent skill from pproenca/dot-skills. Dockerfile optimization guidelines from official Docker documentation.

When should I use Dockerfile Optimise?

Dockerfile Optimise fits situations like: tasks involving Dockerfile creation; Docker image builds; container optimization; multi-stage builds.

How do I install Dockerfile Optimise in Claude Code?

Run `npx skills add pproenca/dot-skills --skill dockerfile-optimise -a claude-code`. Or copy the skill folder (skills/.experimental/dockerfile-optimise in pproenca/dot-skills) into .claude/skills/dockerfile-optimise in your project. Claude Code loads it when a task matches its description.

How do I install Dockerfile Optimise in Codex?

Run `npx skills add pproenca/dot-skills --skill dockerfile-optimise -a codex`. Or copy the skill folder (skills/.experimental/dockerfile-optimise in pproenca/dot-skills) into .agents/skills/dockerfile-optimise in your project. Codex loads it when a task matches its description.

Can I use Dockerfile Optimise in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pproenca/dot-skills --skill dockerfile-optimise -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dockerfile-optimise, .gemini/skills/dockerfile-optimise, .github/skills/dockerfile-optimise and .opencode/skills/dockerfile-optimise in your project.

What does Dockerfile Optimise need to run?

SKILL.md names no scripts, command-line tools or credentials: Dockerfile Optimise is instructions for the agent only. Our summary lists: Docker.

Does Dockerfile Optimise access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dockerfile Optimise safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dockerfile Optimise use?

Dockerfile Optimise is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dockerfile Optimise use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 35k tokens, read only when the agent opens those files.

What are the alternatives to Dockerfile Optimise?

Skills that share tags, products or a category with Dockerfile Optimise: Iron Proxy Gateway for NanoClaw (nanocoai/nanoclaw, 31k stars), GreptimeDB Dev Docker Image (GreptimeTeam/greptimedb, 6.7k stars), Senior DevOps Toolkit (maslennikov-ig/claude-code-orchestrator-kit, 259 stars) and LangBot Deployment Guide (langbot-app/LangBot, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dockerfile Optimise?

pproenca (a GitHub user) maintains it in pproenca/dot-skills, which has 214 GitHub stars. The repository holds 182 skills in this directory. The repository was last updated on August 15, 2026.

Source: pproenca/dot-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.