Dockerfile Linter.
Check a Dockerfile for unpinned images, apt-get pitfalls, shell-form CMD, root users and baked-in secrets.
Runs in your browserAbout Dockerfile Linter
The Dockerfile Linter reads your Dockerfile the way the Docker builder does, joining line continuations, skipping comments, honouring the escape parser directive and understanding BuildKit heredocs, and then checks every instruction against a set of well-known best practices. Each finding has a line number, a severity and a short explanation of why it matters. Errors are things that break the build or silently do something else: an unknown instruction, a file that does not start with FROM, an EXPOSE with a host mapping such as 8080:80, a COPY of several files to a destination that does not end in "/", and a CMD that looks like JSON but uses single quotes, which Docker then runs through /bin/sh instead. Warnings cover reproducibility and security: images without a tag or with :latest, apt-get install without -y, apt-get update in its own RUN layer, piping curl into sh, sudo, chmod 777, secrets in ENV or ARG, COPY --from pointing at a stage name that does not exist, and a final image that runs as root. Notices are smaller wins such as --no-install-recommends, cleaning /var/lib/apt/lists, pip --no-cache-dir and preferring WORKDIR over cd. For example, "CMD nginx -g 'daemon off;'" is flagged because the shell-form process does not receive SIGTERM, so docker stop waits ten seconds and then kills it. The rules are inspired by hadolint but implemented independently, and shell commands are inspected with simple heuristics rather than a full shell parser, so treat findings as advice. The Dockerfile never leaves your browser.
How to Use
- Paste your Dockerfile.
- Read the findings, starting with errors and warnings.
- Fix the lines and paste again until the list is clean.
Frequently Asked Questions
Is this the same as hadolint?
No. The rules cover the same common problems as hadolint's DL rules but are implemented separately, and shell commands inside RUN are checked with heuristics instead of ShellCheck.
Why is "FROM node" a warning?
Without a tag Docker pulls node:latest, which changes over time, so the same Dockerfile builds different images. Pin a version such as node:20.11-alpine or a digest.
Why should CMD use the JSON form?
In shell form your process runs as a child of /bin/sh and does not receive SIGTERM, so containers stop slowly and cannot shut down cleanly. The exec form ["node", "server.js"] runs it directly.
Is my Dockerfile uploaded?
No. Linting happens in your browser.
Related Tools
Validate .env files and compare them with .env.example to find missing, extra and changed variables.
Validate TOML 1.0 with exact line and column errors and tidy its layout while keeping every comment.
Combine .gitignore templates for languages, frameworks, editors and operating systems into one file.
Generate an nginx server block for static sites, SPAs, PHP-FPM, Laravel or a reverse proxy, with HTTPS.
Convert a crontab schedule into a systemd timer and a Kubernetes CronJob, or an OnCalendar back to cron.
Convert between YAML and JSON formats.