Skip to content

Instantly share code, notes, and snippets.

@darron
Created February 27, 2017 19:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darron/63d81a4db2160d72b2a8d796e4c0a9e3 to your computer and use it in GitHub Desktop.
Save darron/63d81a4db2160d72b2a8d796e4c0a9e3 to your computer and use it in GitHub Desktop.
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