1744171099
2025-04-09 01:21:00
Dockerfile形式とパーサー、および最新バージョン dockfmt。内部の上に構築されています buildkit パーサー。
バイナリはから入手できます リリース ページ。
A updated version of the dockfmt. Uses the dockerfile parser from moby/buildkit and the shell formatter from mvdan/sh.
Usage:
dockerfmt [Dockerfile] [flags]
dockerfmt [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
version Print the version number of dockerfmt
Flags:
-c, --check Check if the file(s) are formatted
-h, --help help for dockerfmt
-i, --indent uint Number of spaces to use for indentation (default 4)
-n, --newline End the file with a trailing newline
-w, --write Write the formatted output back to the file(s)
Use "dockerfmt [command] --help" for more information about a command.
-
RUNParserは現在、コマンドのグループ化やセミコロンをサポートしていません - Long JSONコマンドに対してラインラッピングは実行されません
-
# escape=X指令はサポートされていません
貢献は大歓迎です!
RUN "hello"
echo "world"
EOF
- 実行手順での基本的なインラインコメントのサポート:
RUN echo "hello"
# this is a comment
&& echo "world"
RUN echo "hello"
# this is a comment
# that spans multiple lines
&& echo "world"
これは驚くべきことです 非自明 コメントをフォーマットされた出力での位置に添付したいが、事前にパーサーによって剥がされている。
JSバインディングはで利用できます js ディレクトリ。それらの使用方法の詳細については、 readme ファイル。
#Retepsdockerfmtdockerfile形式とパーサー現代のdockfmt