Dockerfile Validator
Check your Dockerfile for syntax errors and best practice violations. Improve your container builds with instant feedback and detailed error reporting to ensure your images are optimized and secure.
Check your Dockerfile for syntax errors and best practice violations. Improve your container builds with instant feedback and detailed error reporting to ensure your images are optimized and secure.
Search for a command to run...
Best Practice
Use .dockerignore to exclude files like .git or node_modules from your build context to speed up builds.
Did You Know?
Each RUN, COPY, and ADD instruction in a Dockerfile adds a new layer to the final container image.
Tip
Combine multiple shell commands into a single RUN instruction using && and line breaks to reduce image size.
Q: Does this tool pull my base images to check if they exist? A: No, the validator focuses on instruction syntax and best practices rather than external registry connectivity.
Q: Can this tool help reduce my Docker image size? A: Yes, it flags patterns like unchained RUN commands that create unnecessary image layers.
Q: Why is using 'latest' for a base image flagged? A: Using 'latest' is a bad practice because it makes your builds unpredictable; the validator encourages specific versioning.
Q: Does it support multi-stage builds? A: Yes, it fully supports the syntax for multi-stage Dockerfiles including the AS keyword and COPY --from instructions.
Best Practice
Always switch to a non-root user using the USER instruction before your application starts for better security.