# Install dockerfmt with Homebrew, Nix

Dockerfile format and parser. a modern dockfmt. Version 0.5.4 via Homebrew; verified 2026-06-28.

## Install

```sh
sudo av install brew:dockerfmt
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install dockerfmt
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#dockerfmt
```

  Evidence: nixpkgs package indexes: pkgs/by-name/do/dockerfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:dockerfmt
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/dockerfmt>
- **Version:** 0.5.4
- **Source summary:** Dockerfile format and parser. a modern dockfmt
- **Homepage:** <https://github.com/reteps/dockerfmt>
- **Repository:** <https://github.com/reteps/dockerfmt>
- **Upstream docs:** <https://github.com/reteps/dockerfmt#readme>
- **License:** MIT
- **Source archive:** <https://github.com/reteps/dockerfmt/archive/refs/tags/v0.5.4.tar.gz>
- **Last updated:** 2026-06-28T00:04:23Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- dockerfmt (cli)
- dockerfmt (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.5.4
- Package-manager updated: 2026-06-28
- Local data: ok
- Upstream repository: https://github.com/reteps/dockerfmt
- Upstream latest detected: v0.5.4 (current)
## Project history and usage

dockerfmt is a young, opinionated Dockerfile formatter that combines Dockerfile parsing with shell-command formatting for `RUN` instructions.

### Project history

The reteps/dockerfmt repository was created in April 2025 and published its initial alpha release the next day. The README presents it as a modern successor to Jessie Frazelle's earlier `dockfmt`, built on the Moby BuildKit parser and using `shfmt` for shell fragments inside Dockerfile `RUN` steps.

The project quickly moved through 0.2.x releases in April 2025 and reached 0.5.4 in June 2026. The README's feature set includes whitespace normalization, inline-comment preservation, legacy `ENV key value` conversion, deprecated `MAINTAINER` conversion to `LABEL`, heredoc support, stdin/file operation, pre-commit support, JS/WASM bindings, and a Docker image for CI.

### Adoption history

Because dockerfmt is new, public adoption evidence is still thin. Its package-manager footprint is nevertheless real: Homebrew reported stable version 0.5.4, 69 installs in the previous 30 days, and 548 installs in the previous year as of June 30, 2026.

Its adoption story is also a lineage story: it exists because Dockerfile formatting remained useful after `dockfmt`, while modern BuildKit syntax, shell formatting expectations, pre-commit workflows, and CI images needed a fresher implementation.

### How it is used

Users run `dockerfmt Dockerfile` to print formatted output, `dockerfmt -w Dockerfile` to rewrite files, `dockerfmt -c Dockerfile` to check formatting, or pipe Dockerfiles through stdin. It can read EditorConfig properties such as `indent_size` and `insert_final_newline` when formatting files by path.

### Why package nerds care

dockerfmt is package-nerd significant because formatters become part of project policy. By exposing a Go binary, Docker image, pre-commit hook, and JS/WASM bindings, it tries to make Dockerfile formatting usable from local editors, CI, JavaScript tooling, and ordinary package managers.

### Timeline

- 2025: Repository created and 0.1.0-alpha initial release published.
- 2025: 0.2.x releases added JavaScript release work and bug fixes.
- 2026: 0.5.4 released and Homebrew formula reports stable 0.5.4.

### Related projects

- dockerfmt is directly related to `dockfmt`, Moby BuildKit's Dockerfile parser, and `shfmt`.
- It also fits into pre-commit and CI formatting workflows, similar to language-specific formatters such as gofmt and prettier, but for Dockerfiles.

### Sources

- <https://github.com/reteps/dockerfmt#readme>
- <https://api.github.com/repos/reteps/dockerfmt>
- <https://github.com/reteps/dockerfmt/releases/tag/0.1.0-alpha>
- <https://github.com/reteps/dockerfmt/releases/tag/v0.5.4>
- <https://formulae.brew.sh/api/formula/dockerfmt.json>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** dockerfmt
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - dockerfmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/do/dockerfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [typstyle](https://www.automicvault.com/pkg/brew/typstyle/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter, formatters.
- [beautysh](https://www.automicvault.com/pkg/brew/beautysh/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.
- [buildifier](https://www.automicvault.com/pkg/brew/buildifier/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.
- [cljfmt](https://www.automicvault.com/pkg/brew/cljfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.
- [dfmt](https://www.automicvault.com/pkg/brew/dfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.
- [fnlfmt](https://www.automicvault.com/pkg/brew/fnlfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.
- [fourmolu](https://www.automicvault.com/pkg/brew/fourmolu/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.
- [fprettify](https://www.automicvault.com/pkg/brew/fprettify/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters.

## Combined YAML source

View the package source record on GitHub. [combined/dockerfmt.yml](https://github.com/automic-vault/db/blob/main/combined/dockerfmt.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
