AWS: Cross region ECS docker registry support

Let’s say you have a docker registry in US-east-1 and you want to pull the registry in eu-central-1.

1. Add this in the IAM role of the EC2 machine

{
  "Effect": "Allow", 
  "Action": [ 
    "ecr:GetAuthorizationToken", 
    "ecr:BatchCheckLayerAvailability", 
    "ecr:GetDownloadUrlForLayer", 
    "ecr:GetRepositoryPolicy",   
    "ecr:DescribeRepositories", 
    "ecr:ListImages", 
    "ecr:BatchGetImage", 
    "ecr:InitiateLayerUpload", 
    "ecr:UploadLayerPart", 
    "ecr:CompleteLayerUpload", 
    "ecr:PutImage" ], 
  "Resource": "*" 
}

2. Set the mtu value

sudo ifconfig eth0 mtu 1500

3. Login

$(aws ecr get-login --region us-east-1)

4. Pull the docker image:

docker pull https://acc_id.dkr.ecr.us-east-1.amazonaws.com/image

Any questions? Please comment.

Leave a Reply

Your email address will not be published. Required fields are marked *