Pulling Docker images from ECR
Now that you have learned how to publish Docker images to ECR, let's focus on how Docker clients running under a variety of scenarios can pull your Docker images from ECR. Recall from the introduction to ECR at the beginning of this chapter that a variety of scenarios exist for client access to ECR, and we will now focus on these scenarios in the context of ECS container instances as your Docker clients:
- ECS container instances running in the same account as your ECR repositories
- ECS container instances running in different accounts to your ECR repositories
- AWS services that require access to your ECR repositories
ECS container instance access to ECR from the same account
When your ECS container instances are running in the same account as your ECR repositories, the recommended method to enable the ECS agents running inside your ECS container instances to pull Docker images from ECR is to use IAM policies associated with the IAM instance role applied to EC2 instance...