Dockerfile Formatter

Format and clean Dockerfiles

Input
Formatted Output

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

1What is it?

Format and validate your Dockerfiles. Organize instructions, fix indentation, and ensure best practices. Keep your container configurations clean and readable.

2Use Cases

  • Standardize Dockerfile style across a team
  • Fix indentation and spacing issues
  • Improve readability of complex multi-stage builds
  • Prepare Dockerfiles for code review

3Examples

Format Dockerfile

Input

FROM node:18
RUN npm install

Output

FROM node:18

RUN npm install

?Frequently Asked Questions

Does it validate syntax?

It performs basic syntax checking and formatting, but for deep validation of package versions or commands, you should try building the Dockerfile.