You now create a AWS ECR private repository and push a dummy Docker image to it.
1. Go to AWS ECR console.
2. Click Create.
3. In the General settings section,
awsome-books
.4. Scroll down to the bottom, click Create repository.
5. Turn on Docker Desktop or any program that can build and push your Docker image to AWS ECR repository. This workshop will use Docker Desktop as an example.
6. Clone the following repository github.com/Definitely-not-AWS-Workshops/ip-printer.
git clone https://github.com/Definitely-not-AWS-Workshops/ip-printer
7. Change the directory to the repository you have just cloned.
cd ip-printer
8. Run the following commands to build and push Docker image to AWS ECR repository,
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <YOUR-AWS-ACCOUNT-ID>.dkr.ecr.us-east-1.amazonaws.com
docker build -t awsome-books .
docker tag awsome-books:latest <YOUR-AWS-ACCOUNT-ID>.dkr.ecr.us-east-1.amazonaws.com/awsome-books:v0.0.0
docker push <YOUR-AWS-ACCOUNT-ID>.dkr.ecr.us-east-1.amazonaws.com/awsome-books:v0.0.0
9. Check out your AWS ECR private repository to find the Docker image with the tag v0.0.0. Make a note of the Image URI using the Copy URI button for a later use.