Skip to content

Commit

Permalink
cmd/prune-contaiers: add a GC script for containers images
Browse files Browse the repository at this point in the history
This script calls skopeo delete to prune image from a remote
directory. Currently only supports the FCOS tag structure.

If no duration is specified, no image will be pruned.

See coreos/fedora-coreos-tracker#1367
See coreos/fedora-coreos-pipeline#995
  • Loading branch information
jbtrystram committed Jul 2, 2024
1 parent 3823521 commit 6761987
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/prune-containers
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/bash

# 1 - list all tags from repo
REGISTRY="quay.io/fedora-ostree-desktops/silverblue"

TAGS_JSON=skopeo list-tags docker://${REGISTRY} | jq -r '.Tags[]'

# 2 go through list and print date and stream
for tag in $TAGS_JSON;
do
echo $tag
done

0 comments on commit 6761987

Please sign in to comment.