AWS CLI Setup And the Use of ECR
Sungwa Yu

Elastic Container Registry (ECR) can be used to stored images (eg. docker images), and deployed to AWS ECS or EKS).

Install AWS CLI

  1. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html.
  2. Verify which aws.

Get Access Key From AWS

  1. Create policy (with ECR permission).

  2. Create user, access type choose access key, then attach the policy.

  3. Download the cvs file that has access key ID and secret access key.

Config AWS CLI.

1
aws configure

Enter the information.

Push Image to ECR

  1. Go to AWS ECR.
  2. Create repository.
  3. Choose the repository and click on the “View push command” button.
  4. Copy the first command, should be prompted “Login Succeeded”.
  5. Run the second command (docker build …) in the directory that has the Dockerfile.