# Dockerfile Linter & Best-Practices Checker

Hadolint-style static analysis for Dockerfiles without a Docker daemon: 30+ rules across image pinning, package-manager hygiene, layer caching, secrets and signal handling, with severities, line numbers and fix examples.

> Canonical page: https://test.elysiatools.com/en/tools/dockerfile-linter

- **Category:** Development

- **Keywords:** dockerfile, hadolint, linter, docker best practices, container image

## Overview

Rule IDs and severities mirror Hadolint v2.15 (DL4000 MAINTAINER=error, DL3025 shell-form CMD=warning, DL3057 HEALTHCHECK=info/optional). The parser handles the # escape= directive, line continuations, BuildKit heredocs, JSON-array form, multi-stage state resets per FROM, and # hadolint ignore=DLxxxx suppressions. BP001 is a platform best-practice extension reminding about .dockerignore on whole-context COPY.

## Inputs

- **Dockerfile content** (textarea): FROM node:20-alpine WORKDIR /app COPY . . RUN npm ci --omit=dev CMD \["node", "server.js"\]
- **Minimum severity shown** (select)
- **Include HEALTHCHECK rule (DL3057)** (checkbox)

## When to use

- Before committing or merging a new or changed Dockerfile.
- When an existing recipe still uses :latest, MAINTAINER, sudo or unpinned packages.
- To confirm a multi-stage production image uses a pinned base, non-root USER, JSON-form CMD and HEALTHCHECK.

## How it works

- Paste the complete Dockerfile; the parser understands # escape=, line continuations, BuildKit heredocs, JSON-array instructions, multi-stage FROM resets and # hadolint ignore comments.
- Optionally raise the minimum severity (info, warning or error) and toggle the HEALTHCHECK rule (DL3057).
- Every matching rule is listed with its Hadolint-style ID, line, explanation and suggested correction, plus the BP001 reminder for whole-context COPY.
- Results render as an HTML summary that counts errors, warnings and info findings.

## Use cases

- Surface classic anti-patterns such as unpinned tags, leftover MAINTAINER, apt-get without cleanup and secrets in ENV.
- Validate a multi-stage Node or Alpine production build for pinning, non-root USER and exec-form CMD.
- Receive a line-level reminder to add a .dockerignore when the recipe copies the entire build context.

## Frequently asked questions

### Do I need Docker installed?

No. Analysis is purely static and runs on the pasted text alone.

### Which rules are checked?

More than 30 rules that mirror Hadolint v2.15 (DL4000, DL3007, DL3025, DL3057 and others) plus the platform extension BP001 for .dockerignore.

### How do I hide informational findings?

Set Minimum severity shown to “Warnings and errors only” or “Errors only”.

### Can I suppress a rule on one line?

Yes. Add a comment # hadolint ignore=DLxxxx (or a comma-separated list) on the instruction.

### Is the HEALTHCHECK check always on?

It is enabled by default but can be turned off with the checkbox if a missing HEALTHCHECK should be ignored.

## Related tools

- [APNG IDAT/fdAT Chunk, Streaming Deflate Replay and Disposal Method Frame-Timing Analyzer](https://test.elysiatools.com/en/tools/apng-idat-fdat-chunk-streaming-deflate-replay-and-disposal-method-analyzer): Upload a PNG or APNG and audit the whole animation structure: PNG signature and per-chunk CRC32 checks, IHDR bit depth / color type / interlace, acTL placement and declared frame counts, every fcTL (region bounds inside the canvas, normalized delay fractions, dispose_op none/background/previous, blend_op source/over), the shared fcTL+fdAT sequence-number contract from 0, per-frame replay of the IDAT/fdAT deflate streams with exact decompressed-size verification, and disposal-semantics audit — first-frame PREVIOUS treated as BACKGROUND, zero-delay frames, loop counts, fps and compression ratios.
- [Color Vision Accessibility Checker](https://test.elysiatools.com/en/tools/color-vision-accessibility-checker): Measure WCAG contrast, simulate major color-vision deficiencies, and optionally flag low-contrast regions in a UI screenshot
- [Email HTML Linter](https://test.elysiatools.com/en/tools/email-html-linter): Check email HTML templates for cross-client compatibility: unsupported CSS, non-inline styles, Outlook traps, table layout issues, and accessibility gaps.
- [Responsive Picture / srcset Art Direction Builder](https://test.elysiatools.com/en/tools/responsive-picture-srcset-art-direction-builder): Build complete markup with art-directed crops: per-breakpoint elements, 1x/2x density candidates or {w}-template width descriptors, optional AVIF/WebP format layers, sizes handling, CLS-safe width/height, plus HTML and JSX flavors with spec-based lint notes.
- [Windows PE / Linux ELF / Mach-O Binary Header, Section, Import & Export Inspector](https://test.elysiatools.com/en/tools/windows-pe-linux-elf-mach-o-binary-header-section-import-export-inspector): Upload a PE-COFF (.exe/.dll), ELF or Mach-O binary and parse its headers end to end: DOS/PE signature, COFF machine, optional header (entry point, image base, subsystem, ASLR/NX/CFG), section table with RVA↔offset mapping, import/export directories, ELF program headers and PIE detection, dynamic symbols and DT_NEEDED, Mach-O load commands and dylibs — with cross-architecture annotations and a hex preview.
- [Accessibility Checker](https://test.elysiatools.com/en/tools/accessibility-checker): Detect common WCAG 2.1 accessibility issues in HTML, fetched pages, or design images and return fix-ready guidance
- [package.json Dependency Auditor](https://test.elysiatools.com/en/tools/package-json-dependency-auditor): Audit a package.json for dependency hygiene, version-range quality, and optionally inspect a transitive dependency tree from package-lock.json or yarn.lock. Flags duplicates, wildcard or pre-release specs, unsorted keys, missing metadata, and misclassified runtime/dev dependencies.
- [Tailwind Color Palette Sync](https://test.elysiatools.com/en/tools/tailwind-color-palette-sync): Generate theme.extend.colors for tailwind.config.ts from HEX colors, with WCAG contrast levels and optional dark mode.

## Samples

- [Android Image Processing Java Samples](https://test.elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://test.elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://test.elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing Rust Samples](https://test.elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion

## Related content

- [Review Dockerfile and Environment Configuration Before Release](https://test.elysiatools.com/en/hubs/container-release-dockerfile-and-env-review): Review Dockerfile findings, validate image references, expose duplicate environment keys and explain staging-to-production drift in one container release record.
