How to push Docker image to ECR in Jenkins? How to push Docker image to ECR in Jenkins? jenkins jenkins

How to push Docker image to ECR in Jenkins?


Default repository of docker.io is being hardcode is : docker.io/library/

So for AWS ECR repo, you should :

docker build -t test-repository .

docker tag test-repository:latest 536703334988.dkr.ecr.ap-southeast-2.amazonaws.com/test-repository:latest

docker push 536703334988.dkr.ecr.ap-southeast-2.amazonaws.com/test-repository:latest

Make sure test-repository repo is already create on ECR.