DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
HomeAPI / ConfigDockerfile Linter

Example: Dockerfile Linter

A worked example, rendered from real sample data. Sign in to run the tool on your own input.

Input
FROM node:latest
RUN apt-get update && apt-get install -y curl
RUN sudo npm install -g pnpm
ADD . /app
WORKDIR /app
RUN npm install
EXPOSE 3000
CMD ["npm", "start"]
Output
8 instructions · 1 build stage · 4 cache layers (RUN/COPY/ADD)
Stages: stage-0 → node:latest
Findings — 0 errors · 6 warnings · 2 notes
WARN  No USER instruction, so the container runs as root  [runs-as-root]
      → RUN adduser -D app && USER app
WARN  line 1  Base image "node:latest" is pinned to :latest — builds are not reproducible  [base-image-latest]
      → FROM node:1.2.3
WARN  line 2  apt-get install pulls recommended packages and bloats the image  [apt-recommends]
      → apt-get update && apt-get install -y --no-install-recommends curl
WARN  line 2  The apt lists stay in this layer — delete them in the same RUN or they are baked in  [apt-lists-not-cleaned]
      → apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
WARN  line 3  sudo is pointless in a build — RUN already executes as the current USER  [run-sudo]
      → RUN npm install -g pnpm
WARN  line 4  ADD is only needed for archives and remote URLs — COPY is explicit and cacheable  [add-over-copy]
      → COPY . /app
NOTE  No HEALTHCHECK — orchestrators cannot tell a hung process from a healthy one  [no-healthcheck]
      → HEALTHCHECK CMD curl -fsS http://localhost:3000/health || exit 1
NOTE  line 6  npm install can rewrite the lockfile during a build  [npm-ci]
      → npm ci

About Dockerfile Linter

Dockerfile Linter preview - API / Config tool

Check Dockerfiles against common best practices. Part of the DevTools Surf developer suite. Browse more tools in the API / Config collection.

Use Cases

  • Validate Dockerfiles before building production images
  • Catch security issues like running containers as root
  • Optimize Docker layer caching for faster CI/CD builds
  • Enforce Dockerfile standards across engineering teams

Tips

  • Paste your Dockerfile to check against best practice rules
  • Fix common issues like missing USER directives
  • Identify inefficient layer ordering that slows builds

Fun Facts

  • Docker was released as open source by Solomon Hykes on March 13, 2013, and reached 1 billion container pulls on Docker Hub within two years.
  • Each RUN instruction in a Dockerfile creates a new layer; combining commands with && can reduce image size by hundreds of megabytes.
  • The Hadolint Dockerfile linter, inspired by ShellCheck, has over 80 rules and parses the Dockerfile AST for structural analysis.

FAQ

What rules does it check?
Hadolint's rule set: use ADD only for URLs, prefer COPY, pin image tags, avoid cd (use WORKDIR), don't run apt-get update alone, no sudo, proper layer caching.
Is it production-grade?
Coverage is comparable to Hadolint's major rules. For comprehensive auditing on a large codebase, run Hadolint in CI — this tool is for quick one-off checks.
Does it check for security?
Yes — running as root, installing unnecessary packages, ADD with URL (vs verified download), and exposing unnecessary ports all get warnings.
Can I ignore specific rules?
Yes — comments like `# hadolint ignore=DL3008` suppress specific rules. The tool respects these as Hadolint would.

Related API / Config Tools

REST HandlerOpenAPI ViewerSwagger to Collection JSONpackage.json AnalyzerKubernetes Manifest ValidatorMock Server Config GeneratorAPI Request BuilderGraphQL Explorer
New · Flagshipsimple REST client

REST Handler — Collections, env vars, history, cURL converter

Send requests, save collections (nested), swap environments, and convert between cURL / Collection JSON / REST Handler YAML.

Open

Popular tools

The most-used tools on DevToolsSurf, one click away.

Encoding & crypto

  • Base64 Encode
  • Base64 Decode
  • URL Encoder
  • URL Decoder
  • Hash Generator
  • JWT Decoder
  • JWT Encoder
  • UUID Generator
  • ULID Generator
  • Password Generator
  • Bcrypt Hash Tester

Converters

  • CSV to JSON
  • JSON to CSV
  • XML to JSON
  • JSON to XML
  • HTML → Markdown
  • HTML → React JSX
  • cURL to Code
  • Collection JSON → cURL
  • Swagger to Collection JSON
  • JSON → Go Struct
  • JSON → TypeScript Types

JSON & YAML

  • JSON Formatter
  • JSON Validator
  • JSON Viewer
  • JSON Minifier
  • JSON Diff
  • JSONPath Tester
  • YAML Formatter
  • YAML to JSON
  • JSON to YAML

Text & regex

  • Regex Tester
  • Text Diff
  • Case Converter
  • Word Counter
  • Markdown Preview
  • Slug Generator
  • Lorem Ipsum Generator
  • Markdown → PDF

CSS & color

  • CSS Beautifier
  • Minify CSS
  • Color Converter
  • Gradient Generator
  • Contrast Checker
  • Color Palette Generator
  • Flexbox Playground
  • Tailwind → CSS

Generators

  • QR Code Generator
  • Mock Data Generator
  • Favicon Generator
  • .gitignore Builder
  • README.md Generator
  • Dockerfile Generator
  • Sitemap Generator

API & networking

  • REST Handler
  • HTTP Header Analyzer
  • IP Address Lookup
  • CIDR Calculator
  • User-Agent Parser
  • HTTP Status Reference
  • OpenAPI Viewer

Date & time

  • Timestamp Converter
  • Timezone Converter
  • Cron Expression Parser
  • Duration Calculator
  • Age Calculator
  • Date Format Converter

Images

  • Image Converter
  • Image Resizer (Batch)
  • SVG Optimizer
  • Base64 ↔ Image
  • WebP ↔ AVIF Converter
  • Image Compressor

PDF tools

  • PDF Merger
  • PDF Splitter
  • PDF Compressor
  • Markdown → PDF
  • EPUB → PDF
  • MOBI / AZW → PDF
  • DOCX → PDF
  • HTML → PDF

Resources

  • Community feed
  • Themes marketplace
  • Pricing & credits
  • Privacy policy
  • Terms of service
  • Sitemap
  • robots.txt

Your account

  • Sign in
  • Dashboard
  • Run history
  • My profile
  • Settings
DevTools Surf logo
DevTools Surf919+ tools

Fast · privacy-first · client-side · © 2026

Home·Feed·ThemesPricing·Sign inPrivacy·Sitemap Feedback