# 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://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

- [Color Vision Accessibility Checker](https://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://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.
- [Accessibility Checker](https://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://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://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.
- [Accessibility Audit Report Generator](https://elysiatools.com/en/tools/accessibility-audit-report-generator): Audit HTML or a URL for common WCAG issues and export a structured PDF report grouped by severity
- [Image Color Palette Extractor](https://elysiatools.com/en/tools/image-color-palette-extractor): Extract dominant colors from an image, export code-ready tokens, and check contrast ratios
- [VP8 Image Analyzer](https://elysiatools.com/en/tools/vp8-image-analyzer): Analyze a WebP/VP8 image with Sharp, generate a grayscale displacement map, and render it as an interactive Three.js 3D relief surface

## Samples

- [Android Image Processing Java Samples](https://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://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://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://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion

## Related content

- [Image Format Conversion and Animated Export Tools](https://elysiatools.com/en/hubs/image-convert): Compare image format converters for JPG, PNG, GIF, AVIF, WebP, TIFF, ICO, base64, and animation-friendly exports in one hub.
- [Image Cleanup, Framing, and Batch Prep Tools](https://elysiatools.com/en/hubs/image-utility): Compare image cleanup, trimming, padding, framing, batch resize/compress, watermarking, and visual polish tools in one hub for asset preparation workflows.
- [Image Metadata, EXIF, and Privacy Cleanup Tools](https://elysiatools.com/en/hubs/image-metadata): Compare image metadata viewers, EXIF/IPTC/XMP inspectors, orientation fixers, metadata editors, and privacy cleanup tools for photo publishing workflows.
- [Image Cleanup, Resize, and Detail Enhancement Tools](https://elysiatools.com/en/hubs/image-cleanup-resize-and-detail-enhancement): Prepare images for delivery with orientation correction, trimming, denoising, resizing, sharpening, and batch conversion.
