Skip to content

Instantly share code, notes, and snippets.

View tahazayed's full-sized avatar

Taha Elsayed tahazayed

View GitHub Profile
@tahazayed
tahazayed / clean.docker.registry.sh
Last active December 12, 2022 08:53 — forked from mohamed-el-habib/clean.docker.registry.sh
bash script to delete images from docker registry using search keyword
#!/bin/bash
# Please follow this artical to allow registry deleation https://azizunsal.github.io/blog/post/delete-images-from-private-docker-registry/#override-the-registry-configuration
# Usage ./clean.docker.registry.sh -r registryUrl -u login -f stringFilter -t tagToKeep
SHORT=r:,u:,f:,k:,h
LONG=dockerRegistry:,user:,imagesFilter:,keepTag:,help
OPTS=$(getopt -a -n clean.docker.regisrty.sh --options $SHORT --longoptions $LONG -- "$@")
eval set -- "$OPTS"