Dockerfile Formatter
Format and clean Dockerfiles
About Dockerfile Formatter
Clean up and standardize your Dockerfiles. This tool capitalizes instructions, removes excess whitespace, and ensures consistent indentation for multi-line commands.
About Dockerfile Formatter & Linter
1What is it?
Format, validate, and lint your Dockerfiles to ensure best practices and readability. This tool organizes instructions, fixes indentation errors, and standardizes spacing to standard Docker conventions. Clean Dockerfiles are easier to maintain, review, and debug.
2Use Cases
- Standardize Dockerfile style across a development team
- Fix indentation and spacing issues before code review
- Improve readability of complex multi-stage builds
- Clean up copy-pasted Docker instructions
- Ensure compliance with Docker best practice guidelines
3Examples
Format Dockerfile
Input
FROM node:18 RUN npm install
Output
FROM node:18 RUN npm install
?Frequently Asked Questions
Why should I format my Dockerfile?
A well-formatted Dockerfile is easier to read and maintain. Proper spacing helps distinguish between build stages and instructions, reducing the chance of errors when modifying the build process later.
Does it check for errors?
It performs syntax validation to ensure the Dockerfile structure is correct. It will flag invalid instructions, but it won't check if packages exist or if commands will succeed at build time.