I use bash and jq to create that script.
#!/usr/bin/env bash
reg=$1
repo=$2
allTags=$(curl -sSLH 'Accept: application/vnd.docker.distribution.manifest.v2+json' http://$reg/v2/$repo/tags/list | jq '.tags' | grep -oP '[^",\[\]\n\s]+')
while read -r tag; do
echo "The following tags will be removed"
echo "$tag"
digest=$(curl -sSL -I -H "Accept: application/vnd.docker.distribution.manifest.v2+json" http://$reg/v2/$repo/manifests/$tag | awk '$1 == "Docker-Content-Digest:" { print $2 }' | tr -d $'\r')
curl -v -sSL -X DELETE "http://$reg/v2/$repo/manifests/$digest"
done <<< "$allTags"
./reg.sh meuregistro:5000 myfuckingproject
The script is based in this Gist - One liner for deleting images from a v2 docker registry