Amazon Elastic Container Registry (ECR)
How to store container images in Amazon ECR
You should use the AWS container registry if:
- one or more components of your stack need to pull or push container images.
The ECR registry is automatically activated once you create an AWS account. However, you'll need to create a
Repositoryin order to push container images to it:
- Make sure the correct region is selected on the top right.
- Click on
The AWS container registry URI should have the following format:
To figure our the URI for your registry:
- Once you have both these values, fill in the values in this template
<ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.comto get your container registry URI.
To use the AWS container registry, we need:
- The ZenML
awsintegration installed. If you haven't done so, runzenml integration install aws
We can then register the container registry and use it in our active stack:
zenml container-registry register <NAME> \
# Add the container registry to the active stack
zenml stack update -c <NAME>
Additionally, we'll need to log in to the container registry so Docker can pull and push images:
# Fill your REGISTRY_URI and REGION in the placeholders in the following command.
# You can find the REGION as part of your REGISTRY_URI: `<ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com`
aws ecr get-login-password --region <REGION> | docker login --username AWS --password-stdin <REGISTRY_URI>