Elastic Container Registry. Select Create

Repository name: fcajresbar-fe.
Image tag mutability: select Mutable.
Encryption configuration: leave it as default.
Click Create to create


Similarly, now we will create for Backend Image. With the following information:
Repository name: fcajresbar-be.
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

fcajresbar-fe

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. Replace the placeholder with the image name you created earlier. Once the build is complete, tagging your image allows you to push it to the repository:
docker tag <source_image>:


fcajresbar-be, remember to copy the login command.

Apply the appropriate tag to your backend image using the following format:
docker tag <source_image>:


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