Skip to content

[Bug]: ImageStore.prune() doesn't remove unreferenced images #417

@realrajaryan

Description

@realrajaryan

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

ImageStore.prune() (which calls ImageStore._prune()) collects blob digests from all images in the store and only deletes blobs not referenced by any image. This means it performs content-store garbage collection but never removes complete images, even if those images aren't used by any containers. We need a way to pass in active image references (from containers) so the method can remove unreferenced images and their blobs.

The container image prune command calls this method and advertises that it removes "unreferenced and dangling images", but because ImageStore.prune() only removes orphaned blobs, users see 0 B reclaimed even when they have many unused images taking up disk space.

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions