This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |