Code · Made a little simpler

Dockerfile Formatter

Format a local Dockerfile while preserving arguments, continued lines, parser directives, full-line comments, line endings and supported heredoc bodies.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Dockerfile Formatter: how to use it

  1. Paste source, open a UTF-8 Dockerfile or select Load example.
  2. Choose whether to remove margins before instruction names, then select Format Dockerfile.
  3. 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.

Guides