Skip to content

filter(docker): add docker build and docker compose filters #39

@mpecan

Description

@mpecan

Goal

Expand Docker filters to cover docker build and docker compose up/logs — the two highest-noise Docker operations. Currently docker/images.toml and docker/ps.toml exist but don't address build or compose output.

Background

docker build (non-BuildKit / --progress=plain): Each RUN step dumps its full stdout/stderr — apt-get installs, pip installs, npm installs. A typical Dockerfile that installs system packages + Python deps + Node deps can emit 1,000+ lines, mostly download progress bars.

docker compose up: Multiplexes logs from all services simultaneously, each prefixed with a color-coded service name. In CI (no TTY) these become plain-text walls with no clear separation between services, making errors from a single service impossible to spot quickly.

Filters to Add

docker/build.tomldocker build / docker buildx build

  • Skip: #X [stage/N] RUN ... step headers for successful steps, download/extraction progress lines (Get:, Fetching, Extracting, Pull complete, Digest:, Status:)
  • Keep: #X CACHED lines (informational about cache hits), ERROR lines, step headers for the step that failed, COPY / ADD step completion, final Successfully built or error summary
  • This is complex because progress format differs between BuildKit and legacy builder

docker/compose.tomldocker compose up / docker compose logs

  • Skip: container startup boilerplate (Attaching to ..., Creating network, Pulling lines for successful pulls)
  • Keep: Error, error, FATAL, panic, WARN level log lines, port binding confirmations, health check results, lines containing failed / exception / crash
  • Note: compose log lines are prefixed with service name; preserve the prefix in kept lines

Fixture Files Needed

  • tests/fixtures/docker/build-success.txt — multi-stage build, mostly cached
  • tests/fixtures/docker/build-failure.txt — build failure buried in apt-get noise
  • tests/fixtures/docker/compose-startup.txt — multi-service compose up output

Acceptance Criteria

  • docker/build.toml removes download/extraction progress from successful builds
  • Build errors and the failing step context are always preserved
  • docker/compose.toml removes routine startup lines
  • Error log lines from any service are always preserved
  • Integration tests pass for all fixture files

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions