Whenever I want to describe an image of a container image I pushed on AWS ECR i would see a JSON similar to below:
aws ecr describe-images --repository-name <my-repo> --region <my-region> --query 'sort_by(imageDetails,&imagePushedAt)[-1]'
{
"registryId": "*****",
"repositoryName": "*******************",
"imageDigest": "sha256:***************************************",
"imageTags": [
"****"
],
"imageSizeInBytes": **********,
"imagePushedAt": "***********************",
"imageManifestMediaType": "***********************************************",
"artifactMediaType": "***********************************************"
}
but with the suffix --output table
you can get a (IMO) much better layout
aws ecr describe-images --repository-name <my-repo> --region <my-region> --query 'sort_by(imageDetails,&imagePushedAt)[-1]' --output table
-------------------------------------------------------------------------------------------------------
| DescribeImages |
+-------------------------+---------------------------------------------------------------------------+
| artifactMediaType | application/vnd.docker.container.image.v1+json |
| imageDigest | sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| imageManifestMediaType | application/vnd.docker.distribution.manifest.v2+json |
| imagePushedAt | 2025-01-01T00:00:00.000000+00:00 |
| imageSizeInBytes | 123456789 |
| registryId | 000000000000 |
| repositoryName | my-repo |
+-------------------------+---------------------------------------------------------------------------+
|| imageTags ||
|+---------------------------------------------------------------------------------------------------+|
|| my-tag ||
|+---------------------------------------------------------------------------------------------------+|