# Dockerfile linter

- Human page: https://happytails.ai/en/developer-tools/dockerfile-linter/
- Markdown: https://happytails.ai/en/developer-tools/dockerfile-linter.md
- Structured JSON: https://happytails.ai/agents/en/developer-tools/dockerfile-linter/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `dockerfile-linter` |
| Category | developer-tools |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Lints a Dockerfile on your device with rules written by Happytails.ai from the Docker documentation. Up to 500,000 characters.

### Inputs and settings

Text input: Dockerfile.

Example or placeholder shown in the interface (not a validated fixture):

```text
FROM node:20-bookworm
WORKDIR /app
COPY . .
CMD ["node", "server.js"]
```

Paste the Dockerfile text. Up to 500,000 characters. Review the settings before running.

No additional settings are declared for this tool.

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

Up to 500,000 characters. Everything runs on your device in a background worker. Downloads: JSON report, CSV findings and SARIF 2.1.0.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "dockerfile-linter",
  "category": "developer-tools",
  "built": true,
  "requirements": "Up to 500,000 characters. Everything runs on your device in a background worker. Downloads: JSON report, CSV findings and SARIF 2.1.0.",
  "implementation": {
    "fields": [],
    "registrationFamily": "config-directive-linters",
    "inputMaxLength": 500000,
    "inputErrorCode": "CONFIG_DIRECTIVE_LINTERS_TOO_LONG_DOCKERFILE",
    "note": "Lints a Dockerfile on your device with rules written by Happytails.ai from the Docker documentation. Up to 500,000 characters.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 500000,
      "inputMode": "text",
      "label": "Dockerfile",
      "placeholder": "FROM node:20-bookworm\nWORKDIR /app\nCOPY . .\nCMD [\"node\", \"server.js\"]",
      "help": "Paste the Dockerfile text. Up to 500,000 characters. Review the settings before running.",
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Check a Dockerfile for invalid instructions, broken stage references and risky build habits such as unpinned base images, apt-get without -y and scripts piped straight into a shell.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

### How to use Dockerfile linter

1. Paste the Dockerfile.
2. Run the check.
3. Review each finding with its line and rule.
4. Download the JSON report, CSV or SARIF file.

## Useful next steps

- [Container environment diff](https://happytails.ai/en/developer-tools/container-environment-diff/) ([Markdown](https://happytails.ai/en/developer-tools/container-environment-diff.md))

- [Environment file validator](https://happytails.ai/en/developer-tools/environment-file-validator/) ([Markdown](https://happytails.ai/en/developer-tools/environment-file-validator.md))

- [YAML validator](https://happytails.ai/en/developer-tools/yaml-validator/) ([Markdown](https://happytails.ai/en/developer-tools/yaml-validator.md))

## What is checked

The instruction table and rules are written by Happytails.ai from the Dockerfile reference and the Docker building best practices guide (docs.docker.com, read on 16 October 2026). Each instruction is checked for its name and argument count, then stages are tracked so COPY --from can be matched to an earlier stage name or index.

### Build habits

The linter flags base images without a version tag, repeated CMD, ENTRYPOINT or HEALTHCHECK, shell form CMD and ENTRYPOINT, relative WORKDIR, apt-get install without -y or cleanup, sudo, curl or wget piped to a shell, ADD where COPY fits, secrets in ENV or ARG names, and containers that run as root. BuildKit heredocs such as RUN <<EOF are read as part of their instruction.

### Limits

Shell commands inside RUN are matched as text, not run or parsed as a full shell script, so unusual quoting can hide a pattern. Base images are not pulled, so a USER set by the base image is not known.
