π³ Dockerfile Linter
π Input Dockerfile
π History
No records yet
What Can the Dockerfile Linter Do?
The Dockerfile Linter is a free online tool that checks your Dockerfile against common best practices. It is built on the Docker specification and the Hadolint rule set, and detects security vulnerabilities, image size optimization opportunities, and other common issues β helping you build smaller, safer, and more reliable container images.
Core Features
- 30+ Check Rules: security, image optimization, and maintainability dimensions
- Three Severity Levels: error (must fix), warning (recommended), info (optimization tip)
- Real-Time Checking: checks as you type β no button click needed
- Concrete Fix Suggestions: each issue includes a code example you can copy
- Quality Score: a 0β100 score that summarizes your Dockerfile quality
- Drag & Drop: check a Dockerfile file directly
How to Use
1. Paste Dockerfile content into the input, or drag a Dockerfile file to upload it
2. Click the "Check" button or press Ctrl+Enter to start checking
3. View the check results: quality score, issue count, and a detailed issue list
4. Click each issue to view its detailed description and fix suggestion
5. Click "Copy suggestion" to copy all suggestions at once
6. Use "Load Example" to see a sample Dockerfile and its issues
Use Cases
Use Case 1: DevOps Review
In a CI/CD pipeline, DevOps engineers use the linter to review Dockerfiles before merge, ensuring they meet security and best-practice standards so insecure images never ship.
Use Case 2: Image Size Optimization
For bloated Docker images, the linter surfaces unmerged RUN layers, uncleaned apt caches, and non-alpine base images. Fixing these issues can reduce image size by over 60%.
Use Case 3: Security Audit
Run a container security audit using the linter to quickly spot running as root, exposed port 22, and using :latest tags β then generate a complete fix list.
Use Case 4: Learning Docker
New Docker users load the example to learn common Dockerfile mistakes and best practices, quickly learning to write high-quality Dockerfiles.
Best Practices
A Dockerfile is the blueprint of a Docker image β its quality directly impacts security, image size, and startup speed. Key best practices include: using multi-stage builds to shrink the final image; choosing lightweight base images like Alpine; merging RUN instructions to reduce layers; using COPY instead of ADD to avoid accidental extraction; running as a non-root user; adding a .dockerignore to exclude unnecessary files; and pinning base image versions instead of using :latest. These practices improve security and deployment reliability.
β What issues can the Dockerfile Linter detect?
It can detect 30+ types of issues, including: using :latest tags, running as root, not cleaning apt caches, consecutive RUN instructions that can be merged, COPY without --chown, missing HEALTHCHECK, using ADD instead of COPY, missing WORKDIR, and insecure ports.
β What standard do the check rules follow?
The rules are based on Docker best practices and the Hadolint rule set, covering security, image size optimization, and maintainability.
β Which Dockerfile instructions are supported?
All standard Dockerfile instructions are supported: FROM, RUN, CMD, LABEL, EXPOSE, ENV, ADD, COPY, ENTRYPOINT, VOLUME, USER, WORKDIR, ARG, ONBUILD, STOPSIGNAL, HEALTHCHECK, SHELL, and more.
β How are check results graded?
Issues are graded into three levels: error (red, must fix β affects security or functionality), warning (yellow, recommended β affects performance or best practices), and info (blue, optimization tip β improves image quality).
β Is my Dockerfile code uploaded to a server?
No. All check logic runs locally in your browser. Your Dockerfile never leaves your device, so your code privacy is fully protected.
β How do I see how to fix an issue?
Each issue includes a concrete suggestion and code example. Click an issue to see the fix, then copy the corrected code with one click.
β Can I check multiple Dockerfiles?
Yes. Paste multiple Dockerfile contents into the input and the tool will analyze the combined result. You can also drag multiple files to check them.