In this step, we prepare the AWS infrastructure required to store our container images. This involves verifying the initial state, creating a necessary IAM Role for ECR replication, and provisioning the repository.
First, verify the current state of the Private Registry. Initially, there are no repositories created.

We need to create a Service-Linked Role that allows Amazon ECR to perform replication actions across regions and accounts.
Elastic Container Registry from the list.

ECRReplicationServiceRolePolicy is attached. This managed policy grants the necessary permissions.
AWSServiceRoleForECRReplication.

Now we create the repository to store the frontend image.
band-up-frontend.
band-up-frontend repository is successfully created with AES-256 encryption enabled by default.
To push images from your local machine, you need programmatic access via the AWS CLI. We will generate an Access Key for your IAM User.
NamDang).ECR Push Key) and click Create access key.

Open your terminal and configure the AWS CLI with the credentials you just generated.
aws configure
Enter the following details when prompted:
ap-southeast-1json
Now that the CLI is configured, we can authenticate Docker and push our image.
Step 1: Login to ECR Run the login command to authenticate your Docker client with the AWS registry.
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin [Account-ID]https://www.google.com/search?q=.dkr.ecr.ap-southeast-1.amazonaws.com
Output: Login Succeeded

Step 2: Tag the Image
We need to tag our local image band-up-frontend:latest with the full ECR repository URI and a version tag (e.g., v1.0.0).
docker tag band-up-frontend:latest [Account-ID].dkr.ecr.ap-southeast-1.amazonaws.com/band-up-frontend:v1.0.0

Step 3: Push the Image Execute the push command to upload the layers to AWS.
docker push [Account-ID].dkr.ecr.ap-southeast-1.amazonaws.com/band-up-frontend:v1.0.0

Return to the Amazon ECR Console and open the band-up-frontend repository. You should see the image with the tag v1.0.0 listed successfully.
