In IAM, create a role with the policy AmazonEC2ContainerRegistryReadOnly Add it to the EC2 instance
Access ECR from EC2How to access Amazon ECR repository from an EC2January 21, 2021 · Nicolas SauvageIn IAM, create a role with the policy AmazonEC2ContainerRegistryReadOnlyAdd it to the EC2 instance