"A registry is just a folder of images." If that were true, any file share would do. A container registry decides who can push and pull, checks images for known vulnerabilities, and cleans up the old ones. On AWS, that registry is Amazon Elastic Container Registry (ECR).
What ECR does
Amazon ECR is a managed registry for Docker and OCI container images (and other OCI-compatible artifacts). You build an image, push it once, and services pull it to run:
- Amazon ECS and Amazon EKS pull images to start containers.
- AWS Lambda functions packaged as container images are deployed from ECR.
- You use the normal Docker or OCI tooling; the AWS CLI gives you a short-lived login token for it.
Besides private registries, ECR Public hosts images anyone can pull, which AWS itself uses to publish images.
Repositories and tags
Images live in repositories, usually one per application or service, such as my-api. Each pushed version gets a tag: my-api:v1, my-api:v2, my-api:latest. Under the tag, every image also has a digest, a content hash that never changes.
A common mistake is deploying latest everywhere. It moves every time someone pushes, so two servers can run different code under the same name. Deploy a specific version tag or digest.
Access, encryption and immutable tags
- IAM policies (on users and roles) and repository policies (on the repository) decide who can push and who can pull. A typical setup: only the CI pipeline's role can push; only the ECS task execution role can pull. See how IAM policies are evaluated.
- Images are encrypted at rest, by default with Amazon S3-managed keys, or with your own AWS KMS key.
- Tag immutability stops anyone from pushing a new image under an existing tag. With it on,
v1always means the same code, which makes rollbacks and audits trustworthy.
Scanning: basic vs enhanced
ECR can scan images for known software vulnerabilities (CVEs). There are two modes:
- Basic scanning uses AWS-native technology to check operating system packages. You scan on push or run a scan by hand.
- Enhanced scanning integrates with Amazon Inspector. It checks OS packages and programming-language packages (for example Python or Node.js libraries), on push and continuously: when a new vulnerability is published, findings are updated and Inspector sends an event to EventBridge so you can alert or block. Inspector charges apply.
Scanning only tells you; it doesn't fix anything. Someone still has to rebuild the image on a patched base and redeploy.
Lifecycle policies and other features
Lifecycle policies delete images by rules such as "keep the last 20 tagged images" or "expire untagged images after 14 days". You pay for the storage ECR uses, so without them, every CI build piles up forever. You can preview a rule before it applies.
Also worth knowing:
- Replication copies images to other Regions or accounts, close to where they run.
- Pull through cache keeps a copy of images from upstream registries such as Docker Hub inside your own ECR, so builds don't depend on someone else's rate limits.
Where AI fits
Model-serving images are often large and packed with Python libraries: frameworks, tokenizers, serving engines. That makes them a big attack surface that changes fast. Keep them in ECR with enhanced scanning on, and Amazon Inspector keeps checking those language packages after you ship, flagging new CVEs in images already running. AWS's own Deep Learning Containers are distributed through ECR too.
Quick recap
- ECR stores your container images; ECS, EKS and Lambda pull from it.
- IAM and repository policies control who pushes and pulls; turn on immutable tags.
- Scanning (basic or enhanced with Inspector) and lifecycle policies keep images safe and tidy.