Build and Push to ECR error
Conditions
Module: Harness CI
Environment:
Infrastructure: Kubernetes
OS: Linux
Delegate location: EKS cluster
AWS connector configuration: Uses IRSA
Problem
The pipeline can pull images from private ECR repositories, but when you try to push an application image with the Build and Push to ECR step, you get the following error:
+ /kaniko/executor --dockerfile=/harness/docker/Dockerfile --context=dir:///harness/ \
--destination=<aws-account-id>.dkr.ecr.sa-east-1.amazonaws.com/hermod:latest --snapshotMode=redo \
--digest-file=/kaniko/digest-file
error checking push permissions -- make sure you entered the correct tag name, \
and that you are authenticated correctly, and try again: \
checking push permission for "<aws-account-id>.dkr.ecr.sa-east-1.amazonaws.com/hermod:latest": \
Post "https://<aws-account-id>.dkr.ecr.sa-east-1.amazonaws.com/v2/hermod/blobs/uploads/": EOF
exit status 1Solution
Configure the Service account in the Kubernetes cluster build infrastructure settings. For example:
Before your Build and Push to ECR step, add a Run step that runs the following command:
Last updated
Was this helpful?