Skip to content

func builders: add disk usage report and prune command #4047

Description

@SeeyaVhora

Hey! I've been using func build regularly across a few projects, and noticed something that might be worth a small feature wanted to check with you before writing any code.

The problem:

func build pulls builder images, run images, and creates buildpack cache layers on every run. Caching is clearly already happening (the CLI notes first builds are slower than later ones), but there's currently no way to see:

  • how much disk space these images/layers are using
  • which builder/run images are still active vs. left over from old projects
  • whether a slow build is a cache miss or something else

Across multiple functions and projects, this accumulates with no built-in way to inspect or clean it up.

  1. func builders prune reports disk usage per builder image, run image, and cache layer, with an option to remove ones no longer referenced by any local func.yaml.
  2. --cache-report flag on func build prints a per-layer cache hit/miss summary.

I checked open and closed issues/PRs for related prune/cache/disk-space work and didn't find anything in progress. If this was discussed or attempted before, I'd appreciate the context. Otherwise, happy to write a short design doc scoping this into reviewable pieces reporting first, prune as a follow-up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions