Input Dockerfile
Paste your code to format it and check its syntax
Options
Adjust formatting and validate
Detect the format on paste. If ambiguous, choose it manually.
Result
Code viewer · Read only
Format and validate Dockerfile online
Format Dockerfile instructions and continuations with dockerfmt. Fold multiline instructions or build stages. Check syntax without building images or executing RUN commands; image and file existence is not checked.
How to use the formatter
- Paste your code in the editor. JSON is the default format on the home page.
- Enable detection on paste or choose the format manually. HTML and XML can be ambiguous.
- Adjust indentation and select Format or Validate. The viewer includes syntax colors and folding for every format. Minification is available for JSON.
Code example Dockerfile
FROM alpine:3.22
RUN echo hello \
&& echo world
CMD ["sh"]
Is my code sent to a server?
No. Processing takes place in your browser. Pasted code is neither uploaded nor stored on the server.
What does validation check?
It checks syntax with the selected format’s parser. It does not execute code or guarantee that a program works correctly. If there is an error, fix the input and validate again.