Skip to content

Instantly share code, notes, and snippets.

@darron
Created February 27, 2017 19:16
Embed
What would you like to do?
Figure out which repos in ECR are empty.
export REPOS=$(aws ecr describe-repositories | jq '.repositories | .[].repositoryName' | cut -d'"' -f 2)
for repo in $REPOS;
do
IMAGES=$(aws ecr list-images --repository-name $repo | grep imageDigest)
if [[ "$?" -eq "1" ]]
then
echo "$repo: empty"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment