Skip to main content
Glama

lint_dockerfile

Lint Dockerfiles statically against 28 rules to detect unpinned images, insecure commands, and cache-busting issues, returning line-numbered rule IDs, severities, explanations, and concrete fixes.

Instructions

Lint a Dockerfile with 28 rules (IDs DL1001-DL1028). Each finding has a rule ID, severity (error/warning/info), the line of the instruction, an explanation, and a concrete fix. Covers unpinned/latest tags, apt/pip/apk/yum hygiene, root user, ADD vs COPY, COPY-before-install cache busting, secrets in ENV/ARG/RUN (values are never echoed), curl|sh, HEALTHCHECK, shell-form CMD/ENTRYPOINT, WORKDIR, sudo, chmod 777 and COPY of node_modules/.git. Suppress with # dockerlint-ignore: DL1003 above an instruction. Never builds anything.

Input Schema

NameRequiredDescriptionDefault
pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does well: it discloses 'Never builds anything' (a clear safety/read-only signal), that secret values are never echoed, and that findings include severity and a concrete fix. It stops short of stating failure modes, e.g. behavior on a missing/non-Dockerfile path.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and scale, then a dense rule summary and the suppression mechanism. The long rule enumeration earns its place by telling the agent exactly what classes of findings to expect, though it could be trimmed slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be re-explained, and the description still summarizes finding structure (rule ID, severity, line, explanation, fix). Combined with the safety note and suppression syntax, an agent has everything needed except explicit `path` semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the single `path` parameter is never described — it is ambiguous whether it expects a Dockerfile file path or a directory containing one. The verb 'Lint a Dockerfile' weakly implies a file path, so some meaning leaks through but not enough to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Lint a Dockerfile') plus concrete scope ('28 rules, DL1001-DL1028'), which cleanly separates it from the sibling lint_compose. An agent can identify this as the Dockerfile-specific linter without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the resource name, and the description usefully documents the in-file suppression syntax (`# dockerlint-ignore: DL1003`). However, it never states when to prefer this over siblings like fix_preview or suggest_multistage, nor any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.