awslabs / amazon-ecr-containerd-resolver

The Amazon ECR containerd resolver is an implementation of a containerd Resolver and Fetcher that can pull images from and push images to Amazon ECR using the Amazon ECR API instead of the Docker Registry API.
Apache License 2.0
98 stars 19 forks source link

Guidance for pulling images from AWS ECR with the containerd api #20

Open ghost opened 4 years ago

ghost commented 4 years ago

I have not had success pulling images down from AWS ECR with containerd following the config file approach outlined here and across several other issues.

The solution in this repo takes a different approach, passing in the resolver function the the Pull method; is this the recommended approach? If not, any pointers to current best practices would be appreciated.

mbadibanga commented 1 year ago
ECR_REGION=<REGION>
ECR_PASSWORD=$(aws ecr get-login-password --region $ECR_REGION)
crictl pull --creds "AWS:$ECR_PASSWORD" <IMAGE:TAG>
robertobado commented 1 month ago

Trying mbadibanga's suggestion, I got a crictl: command not found error on Ubuntu's EKS official base image, but his solution is essentially correct. For those encountering the same error, I could get around it with

ECR_REGION=<REGION>
ECR_PASSWORD=$(aws ecr get-login-password --region $ECR_REGION)
ctr image pull -u "AWS:$ECR_PASSWORD" <IMAGE:TAG>