Skip to content

Instantly share code, notes, and snippets.

View seanslma's full-sized avatar

Sean seanslma

View GitHub Profile
#!/bin/bash
# This script remove tags from local registry, keeping just the n most recents tags
#
# Examples (dryrun and execution):
# ./delete_registry_digests.sh -r http://registry.local:5000 -i test -k 0
# ./delete_registry_digests.sh -r https://registry.example.com -i dev/test -e latest -d
#
# based on: https://gist.github.com/jaytaylor/86d5efaddda926a25fa68c263830dac1?permalink_comment_id=4732942#gistcomment-4732942
# and on: https://stackoverflow.com/questions/31251356/how-to-get-a-list-of-images-on-docker-registry-v2
# Abels changes: