DevOps研发效能
媒体矩阵
开源中国APP
授权协议 MIT
操作系统 跨平台
软件类型 开源软件
所属分类 程序开发常用工具包
开源组织
地区 不详
投 递 者 不详
适用人群 未知
收录时间 2025-04-09

软件简介

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.

限制

  • RUN析器目前不支持命令中的分组或分号
  • 较长的 JSON 命令不会进行换行
  • 不支持# escape=X指令

特点

RUN <<EOF
echo "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"
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
1 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部