strata cleanup
strata cleanup¶
List images safe to delete and the storage deleting them frees
Synopsis¶
Lists deletion candidates: images the staleness policy calls abandoned (untagged, nothing built on them, not pulled within abandoned_pull_days), or those matching --where. A multi-platform index is a candidate only when every platform in it is, and an image another kept image is built on is held.
reclaimable counts each layer once, and only when no kept image still uses it: deleting two images that share a big layer frees it once, and deleting an image whose layers a kept image shares frees nothing. exclusive is what deleting one candidate alone frees. --scope repo counts a layer as freed when no kept image in the same repo uses it, for registries that store layers per repository; the default, registry, is the conservative count. Image configs are not counted.
strata never deletes anything. Export the list with -o csv, or generate ECR lifecycle policies with strata cleanup lifecycle.
Examples¶
strata cleanup
strata cleanup --where 'stale = "abandoned" and repo ~ "*/sandbox/*"'
strata cleanup --where 'tags = 0 and pushed_age > 180d and descendants = 0' --scope repo
strata cleanup -o csv > candidates.csv
Options¶
-h, --help help for cleanup
--limit int candidates and repos to list in table output; other formats list all (default 20)
-o, --output string output format: table, json, csv or ndjson (default "table")
--scope string count a layer as freed when no kept image in the registry (registry) or in the same repo (repo) uses it (default "registry")
--where string select candidates with a query (default: stale = "abandoned")
Options inherited from parent commands¶
--config string config file (default: $XDG_CONFIG_HOME/strata/strata.yaml, ~/.strata.yaml or ./strata.yaml)
--db string index file (default: $XDG_DATA_HOME/strata/strata.duckdb)
--log-level string log level: debug, info, warn or error (default: info)
--platform string platform to pick when a ref names a multi-platform index (default: linux/amd64)
--server string URL of a running strata serve to query instead of the index file
SEE ALSO¶
- strata - Turn a container registry into a queryable lineage graph
- strata cleanup lifecycle - Generate ECR lifecycle policies that expire what strata calls abandoned