Dockerfile Formatter
Tidy Dockerfile commands and present the structure clearly.
Category: Dev Tools
When to use?
Use it to tidy the command case and whitespace of a copied Dockerfile to make it easier to review.
How to use
- Enter the Dockerfile content.
- It uppercases command keywords.
- It removes unnecessary whitespace.
Input Explanation
Enter Dockerfile text with FROM, RUN, COPY, CMD, etc.
Calculation Basis
It tidies whitespace per line and converts major Dockerfile directives to standard uppercase.
Usage Examples
- Review Dockerfiles - Tidy a container config file for readability.
- Tidy copied examples - Standardize the inconsistent case and whitespace of a Dockerfile copied from a blog or doc.
- Tidy before review - Unify the format before commit so reviewers focus on the changes.
Examples
- from node:20 → FROM node:20
- Lowercase from·run·copy directives → standard uppercase
Cautions
- Generated output is for reference; test carefully before production use.
- It focuses on formatting and does not check syntax or validate builds.
FAQ
Does it reorder commands?
No. It keeps the original order and only tidies whitespace and keywords.
What does it tidy?
It uppercases directives like FROM, RUN, COPY and removes leading/trailing whitespace.
Are comments or argument values changed?
It leaves comments (#) and argument values, tidying only directive keywords and whitespace.
Does it catch Dockerfile syntax errors?
No. It focuses on formatting and does not check syntax or validate builds.
Related Tools
- Docker Compose Formatter - Neatly tidy docker-compose YAML.
- .env Sorter - Sort keys in a .env file and find duplicate keys.
- YAML Formatter - Tidy a YAML document with consistent indentation and line breaks.
- JSON Formatter - Beautify or minify JSON strings instantly and check for validity errors.
- UUID Generator - Generate up to 20 cryptographically secure UUID v4 values at once.
- Password Generator - Generate secure random passwords in the browser by choosing length, character set, and count.