Elastic Container Registry. Select Create

Repository name: aws-fcaj-container-app-backend.
Image tag mutability: select Mutable.
Encryption configuration: leave it as default.
Click Create to create


Similarly, now we will create for Frontend Image. With the following information:
Repository name: aws-fcaj-container-app-frontend.
Image tag mutability: select Mutable.
Encryption configuration: leave it as default.
Click Create to create

We need to create each repository for each different application to manage the version of Docker images more easily, especially for future CI/CD implementation.
sudo apt install unzip

sudo curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo unzip awscliv2.zip
sudo ./aws/install

aws --version

aws-fcaj-container-app-frontend

Because when a user uses sudo to log in to ECR with Docker, the credential is saved in the HOME Dir of that user. But when you execute the push or pull command, it will see the credential in Root instead of in HOME Dir which was saved when logging in before.

docker image ls

Run the first command to retrieve an authentication token and authenticate your Docker client with your registry using the AWS CLI

You can skip the second command as your frontend image is already built
Run the third command to tag your image.


aws-fcaj-container-app-backend, remember to copy the login command.



If successful, go to ECR Console, go to each repositories in turn, we can see the result here.
