Skip to content

How to push Docker images to AWS Elastic Container Registry (ECR)

mliukis edited this page Mar 2, 2023 · 4 revisions

To push Docker images to AWS Elastic Container Registry (ECR):

  • Log in as power_user to have AWS CLI credentials by running JPL Access Key Generation script

    • For example: aws-login.darwin.amd64 --pub; export AWS_PROFILE=saml-pub
  • Create repository for the container in ECR if it does not exist (select ECR->Create Repository from AWS Console)

    • We will use public repository public.ecr.aws/o1g8v9b3/its-live in all example commands here
  • Retrieve an authentication token and authenticate your Docker client to your registry

    • aws ecr-public get-login-password --region us-west-2 | docker login --username AWS --password-stdin public.ecr.aws/o1g8v9b3
  • Tag locally built image for the ECR repository:

    • docker tag local_image:tag public.ecr.aws/o1g8v9b3/its-live:v1.0
  • Push newly tagged image to newly created AWS repository:

    • docker push public.ecr.aws/o1g8v9b3/its-live:v1.0