Dockerfile Formatter
Format a local Dockerfile while preserving arguments, continued lines, parser directives, full-line comments, line endings and supported heredoc bodies.
Format Dockerfiles Without Rewriting Data
Dockerfile Formatter: how to use it
- Paste source, open a UTF-8 Dockerfile or select Load example.
- Choose whether to remove margins before instruction names, then select Format Dockerfile.
- Compare arguments, comments and heredoc body lines with the source. Copy the text or download Dockerfile.formatted.
Limits and notes
Uses the standard Dockerfile 1.x syntax subset and up to 250,000 characters or a 1 MB UTF-8 file. Only instruction casing and optional leading margins change. An unsupported frontend, unclear heredoc or selected syntax finding blocks export. Opening a file preserves its line endings while the editor stays unedited.
How your privacy works →Dockerfile Formatter: common questions
What changes in a RUN line?
The instruction name becomes RUN and the margin before it can be removed. The argument text, quotes and continuation lines remain as entered.
How does it format heredocs?
The formatter recognizes supported literal delimiters and keeps every body line and terminating line unchanged.
Will formatting rearrange Dockerfile instructions?
The original order remains intact, including parser directives, comments, FROM instructions and the boundaries between stages.