agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/dockerfile-linting/SKILL.md

dockerfile-linting

Skill8 starsChanged 7 months agoApache-2.0View on GitHub

Lint Dockerfiles using hadolint according to standard best practices. Use when asked to lint or check style/security issues in Dockerfiles.

  • Installs packages

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run this skill when asked to lint or check a Dockerfile for issues.

    line 8
  2. Very specific:

    If hadolint is not installed, inform the user and ask before installing:

    line 17
  3. Very specific:

    NEVER install hadolint without asking the user first.

    line 60
  4. Very specific:

    Always flag missing non-root USER, unpinned base image tags, and unpinned package versions even if hadolint's default severity for them is …

    line 63
  5. Very specific:

    Do not suggest disabling a rule via inline # hadolint ignore=DLxxxx comments unless the user explicitly asks for an exception and confirms …

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dockerfile Linting Skill

Run this skill when asked to lint or check a Dockerfile for issues.

Step 1 — Detect available tooling

which hadolint 2>/dev/null
ls .hadolint.yaml .hadolint.yml 2>/dev/null

If hadolint is not installed, inform the user and ask before installing:

brew install hadolint

Step 2 — Find Dockerfiles

find . -type f \( -iname "Dockerfile" -o -iname "Dockerfile.*" -o -iname "*.dockerfile" \) -not -path "*/node_modules/*" -not -path "*/.git/*"

Step 3 — Run linting (read-only check)

hadolint <Dockerfile>

Respect the project's .hadolint.yaml if present (e.g. ignored rules) — do not override it.

Report all findings grouped by file, with line numbers, rule codes (e.g. DL3008), and severity (error/warning/info/style).


Step 4 — Explain and suggest fixes

hadolint does not auto-fix — for each finding, show the offending line and a suggested replacement. Common fixes:

  • DL3008/DL3018/DL3028: pin package versions (e.g. apt-get install -y package=1.2.3).
  • DL3009: clean up package manager caches in the same RUN layer.
  • DL3025: use JSON/exec form for CMD/ENTRYPOINT.
  • DL3002: avoid running as root — add a USER instruction.
  • DL3006: pin the base image tag (avoid latest).
  • DL4006: set SHELL ["/bin/bash", "-o", "pipefail", "-c"] before any piped RUN command.

Rules

  • NEVER install hadolint without asking the user first.
  • Respect the project's existing .hadolint.yaml ignore list — do not re-flag rules the project has intentionally silenced, but you may mention them if they look unsafe (e.g. ignoring DL3002, running as root).
  • Report the exact command run and its full output — do not summarize away findings.
  • Always flag missing non-root USER, unpinned base image tags, and unpinned package versions even if hadolint's default severity for them is only "info" or "style" — these are security-relevant in production images.
  • Do not suggest disabling a rule via inline # hadolint ignore=DLxxxx comments unless the user explicitly asks for an exception and confirms the reason.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.