Dive
$ dive Community Low RiskDive (dive) inspects Docker and OCI container image layers, file trees, and wasted bytes caused by duplicated or overwritten files. While its default invocation opens an interactive TUI, passing --ci (CI=true) or --json <path> turns it into a non-interactive image efficiency gate.
brew install dive dive analyzes local image tarballs and daemon layers directly on disk; MCP adds no value.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
--ci and --json <file> enable clean non-TTY execution and structured output, though bare dive <image> hangs in an interactive TUI and --json writes to a file rather than stdout.
--cibypasses TUI and returns pass/fail exit codes--json <file>writes structured report to disk instead of stdout
Strictly analyzes image layers without mutating images or containers (only writes an optional JSON report file).
- Read-only image layer inspection
Single Go binary across macOS, Linux, and Windows via Homebrew and GitHub Releases.
- Cross-platform binary via
brew install dive
Uniquely surfaces wasted bytes from multi-stage leaks and layer overwrites, speeding up Dockerfile optimization.
- Calculates exact efficiency score and wasted file bytes per layer
Community MIT project (wagoodman/dive) with slower release cadence in recent years.
- Maintained at
wagoodman/diveunder MIT license
Concise README covering --ci thresholds and .dive-ci config, plus --help.
- CI flags documented in upstream README
Security, Auth & Guardrails
Reads local Docker daemon or Podman socket (--source docker|podman|docker-archive) with no Dive-specific credentials.
100% free and open-source (MIT).
# Dive Agent Rules - NEVER invoke bare `dive <image>` without `--ci` or `--json <path>`—the default mode opens a blocking interactive TUI. - Prefer `--source docker-archive` when analyzing local `.tar` exports without a running daemon.
Agent-Ready Command Recipes
Safe Read-Only Queries
dive app:dev --ci --highestUserWastedPercent 0.15
Evaluates image layer efficiency without launching the TUI and exits non-zero if wasted space exceeds 15%.
dive app:dev --json dive-report.json
Writes layer sizes, efficiency score, and inefficient file paths to dive-report.json non-interactively.
Strengths for Agents
- +
--ciand--json <file>transform an interactive TUI into an automated image-bloat gate. - + Identifies exact duplicate/deleted files across layers that inflate image size.
- + Supports
docker,podman, anddocker-archivetarball sources.
Caveats & Pitfalls
- ! Calling
dive <image>without--cior--jsonlaunches a blocking interactive TUI. - !
--json <path>writes to a file on disk rather than streaming JSON to stdout.