Skip to content
Software capabilities
Amazon ECR

Describe images in an Amazon ECR repository

Use the AWS CLI or the Go SDK to inspect image tags, digests, and push timestamps in an ECR repository.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. CLI: aws ecr describe-images
  2. SDK: ecr.Client.DescribeImages
CLI

aws ecr describe-images

Describe image metadata in one repository. Pass --image-ids to select specific tags or digests, or --filter tagStatus=TAGGED to limit the listing to tagged images.

Read source: AWS CLI ECR describe-images
Requirements
AWS credentials with ecr:DescribeImages, a repository name, and the repository’s Region.
Limitations
The CLI’s --max-items can truncate the output. Resume with --starting-token set to the NextToken returned by the CLI.

Example shell

aws ecr describe-images --repository-name "$REPOSITORY" --filter tagStatus=TAGGED --max-items 100
SDK

ecr.Client.DescribeImages

Call DescribeImages with a repository name and optional image IDs or tag filters. Follow NextToken to retrieve more results.

Read source: AWS SDK for Go v2 DescribeImages
Requirements
An AWS SDK for Go v2 ECR client configured for the repository’s Region and ecr:DescribeImages permission.
Limitations
MaxResults supports 1 to 1,000 results per page. Omit MaxResults and NextToken when selecting images by ImageIds.

Example text

input := &ecr.DescribeImagesInput{RepositoryName: aws.String("example-app")}
pages := ecr.NewDescribeImagesPaginator(client, input)
page, err := pages.NextPage(ctx)