ECR tags, digests and permissions
What ECR stores
Amazon Elastic Container Registry (ECR) stores and distributes container images. A registry is the service boundary for repositories; a repository holds named versions of an application image. The image contains metadata and references to filesystem layers. ECS or EKS can retrieve an image and run its application; ECR itself does not run containers. Imagine a shop building one API image and deploying the same artifact to several workers.
Read an image reference
The first line names a tag, the second names a manifest digest. These are illustrative identifiers, not reachable resources. A tag is a label that can point to another manifest when overwrites are allowed. A digest identifies specific manifest content. An image index can identify a set of platform-specific manifests; confirm the target architecture. The digest is not the local image ID and does not by itself prove who built the image.
111122223333.dkr.ecr.eu-west-1.amazonaws.com/shop/api:release-7111122223333.dkr.ecr.eu-west-1.amazonaws.com/shop/api@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAuthenticate and authorize separately
A private registry uses AWS identity to obtain registry authentication. For Docker, a common CLI v2 workflow is to request a password with aws ecr get-login-password --region eu-west-1 and pipe it directly to docker login --username AWS --password-stdin with the approved registry hostname. This is a command pattern for an optional authorized lab, not a command to run here. The ordinary ECR authorization token lasts 12 hours. The IAM identity needs ecr:GetAuthorizationToken with resource *; repository operations still require their own permissions. A pull role typically needs ecr:BatchGetImage, ecr:GetDownloadUrlForLayer and, where needed, ecr:BatchCheckLayerAvailability. Upload and manifest-write actions belong to a separate build role. For another account, coordinate both identity and repository permissions; explicit denies and other policy boundaries still matter.
Choose private or public distribution
Private repositories are the default for proprietary application artifacts. ECR Public is a separate distribution surface intended for publicly accessible images; do not copy private software there accidentally. Use immutable release tags where appropriate, and record the digest in a deployment manifest. A mutable tag such as latest is convenient for development but cannot identify a reproducible release. Tag immutability prevents overwriting protected tags, not deletion or every form of image loss.
Practice: choose a deployment identity
Suppose release-7 points to digest A and a development tag later moves to digest B. A deployment pinned to A still selects A if it remains available. A deployment using the moving tag can select B on a later pull. Explain why successful authentication alone does not permit a push. For practice, inspect the offline registry fixture; no Docker daemon or AWS login is required.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
ECR tags, digests and permissions — knowledge check
Apply the lesson to offline container distribution scenarios.
Which service stores the shop image rather than running its containers?
A tag moves from A to B. What selects A if still available?
A build role can obtain a registry token but has no write permission. What is true?
Which distribution fits proprietary images by default?
What does immutable tagging protect against?