Error output in Jenkins pipeline, docker image is built but the image is unable to punch to AWS ECR repository:
- aws ecr get-login-password –region ap-south-1
- docker login –username AWS –password-stdin 010928217164.dkr.ecr.ap-south-1.amazonaws.com/java-application
Error saving credentials: error storing credentials – err: exit status 1, out: `pass not initialized: exit status 1: Error: password store is empty. Try “pass init”
Any suggestions to solve this error?
New contributor
Vishwanath.U is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
There is a mismatch between the AWS region you are using to obtain the ECR login credentials and the region where your ECR repo is.
You need to log in to the region where you ECR is:
region="ap-south-1"
# or
region="us-east-1"
aws ecr get-login-password --region "${region}" | docker login --username AWS --password-stdin 010928217164.dkr.ecr.${region}.amazonaws.com/java-application