Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dockerfile-roast

> DevOps
Open source

droast - a dockerfile linter that actually has opinions

973 stars0 likes4 views
WebsiteGitHub

About

droast - a dockerfile linter that actually has opinions

・

docs ・ site ・ GH action ・ Wasmer ・ comparison ・ ☕

droast

a dockerfile linter that actually has opinions. it catches bad practices and tells you about them in the least diplomatic way possible.

think of it as code review from a senior dev who's seen too many prod incidents and has stopped being polite about it.

the span-aware parser understands heredocs, parser and escape directives, shell and JSON forms, BuildKit flags such as RUN --mount, Windows paths, and PowerShell — and reports malformed Dockerfile syntax as DF071.

vs code extension

install from the marketplace and get inline squiggles as you type:

droast — Dockerfile Linter

bash
code --install-extension ImmanuelTikhonov.droast

the binary is bundled — no separate install needed. findings appear in real time with roast messages on hover.

neovim extension

Install the dependency-free Neovim plugin in one command; no plugin manager is required:

bash
curl -fsSL https://raw.githubusercontent.com/immanuwell/dockerfile-roast/main/scripts/install-neovim-extension.sh | sh

Or use the dedicated droast.nvim repository with your preferred plugin manager:

lua
-- lazy.nvim:  { "immanuwell/droast.nvim" }
-- packer.nvim: use "immanuwell/droast.nvim"
-- mini.deps: MiniDeps.add({ source = "immanuwell/droast.nvim" })

It starts automatically with droast on PATH, lint-on-save, and native diagnostics. Override defaults with require("droast").setup({ args = { "--preset", "production" } }).

install

don't want to install anything? pick one:

Docker:

bash
docker run --rm \
  -v "$PWD:/workspace:ro" \
  -w /workspace \
  immanuwell/droast:1.7.0 \
  --no-roast .

replace . with Dockerfile to lint one file. The same image is also available from ghcr.io/immanuwell/droast.

Web: use the droast web linter. it runs in your browser.

Binary: download your platform binary from the latest release.

one-liner (macOS and Linux, detects Homebrew automatically):

bash
curl -fsL ewry.net/droast/install.sh | sh

Homebrew (macOS and Linux):

bash
brew install droast

Cargo (crates.io, builds from source):

bash
cargo install dockerfile-roast

Embedding droast in a Rust tool? See the Rust library docs.

Wasmer (Wasmer Registry, sandboxed WASI command):

…

bash droast fixes Dockerfile droast --fix --dry-run --format diff .


Apply every available safe fix, or select particular fixers:

```bash
droast --fix Dockerfile
droast --fix DF076,DF079 Dockerfile

…

bash
droast invocations .
droast invocations --format json .

…

toml
# droast.toml — all fields optional
preset       = "production"       # minimal | security | performance | production | strict
skip         = ["DF012", "DF022"]
min-severity = "warning"
fail-on      = "warning"          # optional: make warnings fail CI
no-roast     = true

[severity-overrides]
DF020 = "error"

[shellcheck]
mode = "auto" # off (default) | auto | required
exclude = ["SC2086"]

[workflow]
engine = "podman" # docker (default) | podman

…

bash
droast --config .lint/droast.toml Dockerfile

Shared TOML files are also supported: place the same settings under [tool.droast] (for example in pyproject.toml) and pass that file to --config.

To migrate a Hadolint policy, generate an equivalent droast.toml from its YAML configuration:

bash
droast init --from-hadolint .hadolint.yaml

Compatible settings and Hadolint DL rule aliases are imported; Droast reports every setting or rule that has no equivalent so the migration stays reviewable.

Or replace a Hadolint invocation directly, without converting configuration:

bash
droast --hadolint-compatible Dockerfile

…

dockerfile
# droast ignore=DF001 reason="PLAT-142 migration" expires=2026-09-30
FROM alpine:latest

See the complete configuration guide and the copy-paste examples/droast-enterprise.toml. None of these controls are required; zero-config behavior stays unchanged.

custom messages

Optional message overrides add team guidance, migration links, or your own tone to terminal output. They do not change rules, exit codes, or JSON/SARIF/GitHub output.

bash
# personal overrides in your OS config directory
droast messages init

# reviewed, shared overrides for this repository
droast messages init --project

Edit the generated YAML, then run droast again. It reads the file every time. See custom messages for layering, examples, placeholders, and validation.

github action

add droast to any repo in 5 lines:

yaml
- uses: immanuwell/[email protected]

full example (.github/workflows/lint.yml):

yaml
name: Lint Dockerfiles

on: [push, pull_request]

jobs:
  droast:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: immanuwell/[email protected]

…

yaml
- uses: immanuwell/[email protected]
  with:
    files: '**/Dockerfile'
    preset: production
    skip: DF012,DF022
    no-fail: true        # report findings but don't block the PR
    baseline: .droast-baseline.json
    only-new: true       # hide accepted findings; requires baseline

pre-commit

roast Dockerfiles before they even reach CI, via pre-commit:

yaml
- repo: https://github.com/immanuwell/dockerfile-roast
  rev: 1.7.0
  hooks:
    - id: droast

the hook runs on Dockerfile, Dockerfile.*, *.Dockerfile, *.dockerfile, Containerfile, and Containerfile.*, while excluding Dockerfile-specific .dockerignore files. pass flags through args as usual:

yaml
    - id: droast
      args: [--min-severity, warning, --skip, DF012]

docker

pull from Docker Hub (or use the identical GHCR image) and use immediately, no install needed:

bash
# lint a Dockerfile in the current directory
docker run --rm -v "$(pwd)/Dockerfile":/Dockerfile immanuwell/droast /Dockerfile

# lint any file, anywhere
docker run --rm -v /path/to/your/Dockerfile:/Dockerfile immanuwell/droast /Dockerfile

# pass flags as usual
docker run --rm -v "$(pwd)/Dockerfile":/Dockerfile immanuwell/droast \
    --no-roast --min-severity warning /Dockerfile

or build locally from source:

bash
docker build -t droast .
docker run --rm -v "$(pwd)/Dockerfile":/Dockerfile droast /Dockerfile

the image is published automatically to Docker Hub as immanuwell/droast and to GHCR as ghcr.io/immanuwell/droast on every release tag. Both registries receive the same version, major/minor, and latest tags.

podman

the same OCI image works with rootless Podman. Mount the repository with :Z on SELinux hosts so Podman can relabel it for the container:

bash
podman run --rm \
    -v "$PWD:/workspace:Z" \
    -w /workspace \
    ghcr.io/immanuwell/droast \
    --engine podman .

--engine podman makes DF033 follow Podman’s .containerignore-before-.dockerignore precedence; it does not require a Podman daemon or change Dockerfile parsing. Persist that workflow for a repository with:

toml
[workflow]
engine = "podman"

Podman preprocesses Containerfile.in with CPP. Droast reports DF075 as an informational reminder to lint the generated Containerfile as part of that build workflow.

wasmer

droast is also published as a WASI package in the Wasmer Registry. It uses the same CLI and rule engine as the native binary.

Lint through stdin without granting filesystem access:

bash
wasmer run immanuwell/droast -- \
    --check-dockerignore=false --format compact -  ~/.zfunc/_droast

# fish — add to config.fish
droast completion fish | source

what it catches

85 rules, ngl thats a lot. run droast --list-rules for the full breakdown.

all 85 rules


  Available Rules

  ID       SEVERITY CATEGORIES                         DESCRIPTION
  ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  DF001    WARN     correctness,reproducibility        Use specific base image tags instead of 'latest'
  DF002    ERROR    security                           Do not run as root
  DF011    INFO     performance                        Use multi-stage builds to reduce image size
  DF013    ERROR    security                           Avoid hardcoded credentials in RUN commands
  DF014    ERROR    security                           Avoid hardcoding passwords or tokens in ARG/ENV
  DF020    INFO     security                           Set explicit non-root USER
  DF003    INFO     performance                        Combine RUN commands to reduce layers
  DF004    WARN     performance                        Clean apt/apk cache before it reaches the final image
  DF005    INFO     correctness,reproducibility        Pin package versions for reproducibility
  DF006    WARN     maintainability,performance        Avoid ADD for local files; prefer COPY
  DF007    WARN     performance                        Do not copy the entire build context (COPY . .)
  DF008    INFO     maintainability,performance        Use WORKDIR instead of inline cd commands
  DF009    WARN     correctness,maintainability        Use absolute paths in WORKDIR
  DF010    WARN     security                           Avoid using sudo inside containers
  DF012    INFO     maintainability,reliability        Set HEALTHCHECK for long-running services
  DF017    WARN     maintainability,reliability        Use ENTRYPOINT with CMD for flexible images
  DF018    WARN     correctness,reliability            Avoid using shell form for ENTRYPOINT
  DF019    WARN     correctness,maintainability        Do not use deprecated MAINTAINER; use LABEL instead
  DF022    INFO     maintainability,reliability        Specify EXPOSE for documented ports
  DF023    INFO     correctness,maintainability        Name intermediate stages instead of relying on numeric indexes
  DF024    WARN     correctness,reproducibility        Avoid using :latest in FROM even with aliases
  DF025    WARN     correctness,reliability            Use JSON array syntax for CMD/ENTRYPOINT
  DF026    WARN     maintainability,performance        Avoid broad local COPY to the filesystem root
  DF030    INFO     performance                        Avoid using pip without --no-cache-dir
  DF031    INFO     performance                        Avoid npm install without ci/--production for prod images
  DF032    INFO     maintainability,reliability        Set PYTHONDONTWRITEBYTECODE and PYTHONUNBUFFERED for Python images
  DF033    INFO     performance,security               Use an effective .dockerignore for each build context
  DF034    ERROR    security                           Avoid persistent world-writable chmod modes
  DF035    INFO     maintainability,reliability        Avoid using curl without --fail flags
  DF036    INFO     maintainability,reliability        Avoid Dockerfile with no CMD or ENTRYPOINT
  DF015    ERROR    correctness,reliability            Avoid using apt-get without -y flag
  DF016    INFO     performance                        Use --no-install-recommends with apt-get
  DF021    ERROR    security,supply-chain              Avoid executing unverified remote scripts
  DF027    ERROR    correctness,reliability            Do not use yum without -y flag
  DF028    WARN     performance                        Cache-bust apt-get update
  DF029    WARN     performance                        Avoid apk add without --no-cache
  DF037    ERROR    correctness,

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustcicontinious-integrationdockerdockerfile

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理