Setting up AWS ECR and pushing an image into it
Amazon EC2 Container Registry (Amazon ECR) is a Docker registry service managed by AWS. ECR is scalable, secure, and reliable. ECR supports private Docker repositories with resource-based permissions using IAM so that specific users or AWS EC2 instances can access repositories and images. Using ECR is a bit different than using a Docker hub in terms of authenticity and permissions. The following are some components of Amazon ECR:
- Registry: The Amazon ECR registry is provided to each AWS account (as of writing this book, it is available in 12 regions only; for now, it means that it's not available in Mumbai, Seoul, and Sau Paulo). We can create repositories in the registry and store an image in that repository.
- Authorization Token: To access the ECR, the Docker client needs to authenticate to Amazon ECR registries as an AWS User before it can push and pull images. We can authenticate to ECR using the AWS CLI get-login command (we will learn about...