For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 1

Solution

  1. Before your Build and Push to ECR step, add a Run step that runs the following command:

Last updated

Was this helpful?