Skip to content

Instantly share code, notes, and snippets.

@AnilPothula
Forked from shcallaway/count-ecr-images.sh
Created February 1, 2021 22:01
Show Gist options
  • Save AnilPothula/d82dc737f2775699e4abf089f243dbc1 to your computer and use it in GitHub Desktop.
Save AnilPothula/d82dc737f2775699e4abf089f243dbc1 to your computer and use it in GitHub Desktop.
Count the number of images in an AWS ECR repository
#!/bin/bash
aws ecr list-images --repository-name $1 | jq '.imageIds | unique_by(.imageDigest) | length'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment