Dockerfile Linter
Lint Dockerfiles for best practices: layers, caching, security, size.
"FROM node" has no pinned tag (defaults to latest). Pin an explicit version for reproducible builds.
COPY . . before dependency install invalidates the layer cache on every change. Copy manifests first, then RUN install, then the rest. Also consider a .dockerignore.
Run "apt-get update && apt-get install -y …" in one RUN to avoid stale apt indexes and extra layers.
Add --no-install-recommends to avoid pulling suggested packages and bloating the image.
curl/vim/nano/jq bloat production images. Install them only in a dev stage or remove after use.
npm ci is deterministic and faster in CI/container builds when a lockfile is committed.
Hardcoded secrets in Dockerfiles are leaked in image history. Use build args / secrets or runtime env injection.
No USER instruction found — the container will run as root. Add USER to run as a non-privileged user.
Rule-based best-practice linting (Dockerfile reference + hadolint guidance). Layer count is an estimate: one per FROM/RUN/COPY/ADD plus the base image. .dockerignore presence cannot be verified from the Dockerfile alone. Runs entirely in your browser.
Lint Dockerfiles against Docker best practices: base image pinning, layer caching order, apt-get hygiene, healthchecks, and secret handling. Get a severity-tagged report with a compliance score.
- -Parses RUN, COPY, ADD, ENV, FROM and more
- -Handles heredocs and line continuations
- -Unpinned base tag and multi-stage warnings
- -apt-get and pip caching rules
- -Secrets-in-ENV and debug-tools detection
- -Score report with copy-to-clipboard summary
- >Reviewing a Dockerfile before it hits CI
- >Teaching container best practices in code review
- >Shrinking image size with layer hints
- >Hardening production images against supply-chain issues