> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick start

> Lint your first Dockerfile in under a minute.

<Steps>
  <Step title="Install tally">
    Pick your preferred package manager:

    <CodeGroup>
      ```bash Homebrew theme={null}
      brew trust --formula wharflab/tap/tally
      brew install --require-sha wharflab/tap/tally
      ```

      ```bash mise theme={null}
      mise use -g github:wharflab/tally@latest
      ```

      ```bash npm theme={null}
      npm install -g tally-cli
      ```

      ```bash Bun theme={null}
      bun add -g tally-cli
      ```

      ```bash uv theme={null}
      uv tool install tally-cli
      ```

      ```bash pip theme={null}
      pip install tally-cli
      ```

      ```bash Go theme={null}
      go install github.com/wharflab/tally@latest
      ```
    </CodeGroup>

    See [Installation](/installation) for WinGet, RubyGems, Docker, and from-source options.
  </Step>

  <Step title="Lint a Dockerfile">
    Run tally against a single file or an entire directory (recursive):

    ```bash theme={null}
    # Single file
    tally lint Dockerfile

    # All Dockerfiles in the current repo
    tally lint .
    ```

    tally discovers files matching `Dockerfile`, `Dockerfile.*`, `*.Dockerfile`, `Containerfile`, and `Containerfile.*`.

    To make the same lint command available through Docker, register the Docker CLI plugin:

    ```bash theme={null}
    tally register-docker-plugin
    docker lint Dockerfile
    ```
  </Step>

  <Step title="Lint a Bake or Compose entrypoint">
    If your build is defined by Docker Buildx Bake or Docker Compose, pass that file directly:

    ```bash theme={null}
    # Lint Bake targets from the default group
    tally lint docker-bake.hcl

    # Lint Compose services with build sections
    tally lint compose.yaml
    ```

    Use `--target` for Bake targets or groups and `--service` for Compose services:

    ```bash theme={null}
    tally lint docker-bake.hcl --target api
    tally lint compose.yaml --service api
    ```

    See [Build invocations](/guides/build-invocations) for context handling, output attribution, and limitations.
  </Step>

  <Step title="Read the output">
    By default tally prints human-readable output with source snippets:

    ```text theme={null}
    WARNING: StageNameCasing - https://docs.docker.com/go/dockerfile/rule/stage-name-casing/
    Stage name 'Builder' should be lowercase

    Dockerfile:2
    ────────────────────
       1 │ FROM alpine
    >>>2 │ FROM ubuntu AS Builder
       3 │ RUN echo "hello"
    ────────────────────
    ```

    Exit code `1` means violations were found. Exit code `0` means clean.
  </Step>

  <Step title="Apply safe fixes">
    Many rules are auto-fixable. Apply all safe fixes with `--fix`:

    ```bash theme={null}
    tally lint --fix Dockerfile
    ```

    <Warning>
      `--fix` modifies files in place. Commit your changes before running it, or review the diff afterward.
    </Warning>
  </Step>

  <Step title="Add a config file">
    Create `.tally.toml` in your project root to set defaults for your whole team:

    ```toml .tally.toml theme={null}
    [output]
    format = "text"
    fail-level = "warning"

    [rules]
    include = ["buildkit/*", "tally/*", "hadolint/*"]
    ```

    Config is discovered automatically — no `--config` flag needed.
  </Step>

  <Step title="Enable context-aware rules">
    In direct Dockerfile mode, pass `--context` to unlock rules that check `.dockerignore` interactions:

    ```bash theme={null}
    tally lint --context . Dockerfile
    ```

    Bake and Compose entrypoints derive the build context from the selected target or service, so they do not use `--context`.
  </Step>

  <Step title="Suppress a violation inline">
    Use an inline directive to suppress a specific rule on the next line:

    ```dockerfile theme={null}
    # tally ignore=StageNameCasing
    FROM alpine AS Build
    ```

    Add a reason to document why:

    ```dockerfile theme={null}
    # tally ignore=DL3007;reason=Pinning at CI level via Renovate
    FROM ubuntu:latest
    ```
  </Step>
</Steps>

## Lint from stdin

Pass `-` as the filename to read from stdin. Useful in pipelines:

```bash theme={null}
cat Dockerfile | tally lint -
```

With `--fix`, the fixed content is written to stdout:

```bash theme={null}
cat Dockerfile | tally lint --fix - > Dockerfile.fixed
```

## Next steps

<CardGroup cols={2}>
  <Card title="Configuration" icon="gear" href="/guides/configuration">
    Full reference for `.tally.toml`, environment variables, and CLI flags.
  </Card>

  <Card title="Build invocations" icon="layers" href="/guides/build-invocations">
    Lint Dockerfiles through Bake targets and Compose services.
  </Card>

  <Card title="Auto-fix" icon="wand-magic-sparkles" href="/guides/auto-fix">
    Learn about safe and unsafe fixes, and per-rule fix modes.
  </Card>

  <Card title="Rules reference" icon="list-check" href="/rules/overview">
    Browse all rules across BuildKit, tally, Hadolint, and ShellCheck namespaces.
  </Card>

  <Card title="CI/CD integration" icon="code-branch" href="/guides/ci-cd">
    Add tally to GitHub Actions, GitLab CI, and other pipelines.
  </Card>
</CardGroup>
