Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

cloud build doesn't recognize build directory for docker images to artifact registry

Hi Team,

cloud build doesn't recognize build directory for docker images to the artifact registry, whily triggering job its throwing error as 

tep #2: Successfully built 42d23e382d82
Step #2: Successfully tagged asia-south1-docker.pkg.dev/gcp/csd-icp-product:e442b278-a43d-4eb3-b3e8-5550d45691f8
Finished Step #2
Starting Step #3
Step #3: Already have image (with digest): gcr.io/cloud-builders/docker
Step #3: The push refers to repository [asia-south1-docker.pkg.dev/gcpnagement/csd-icp-product/663638a1-fa3a-41ed-b51e-80eb88ffb6f6]
Step #3: An image does not exist locally with the tag: asia-south1-docker.pkg.dev/gcpfleetmanagement/csd-icp-product/663638a1-fa3a-41ed-b51e-80eb88ffb6f6
Finished Step #3
ERROR
ERROR: build step 3 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1

 any idea what is causing this isssue, here's full script cloudbuild.yaml

steps:
  #- name: 'maven:3.6.3-jdk-8'
   # entrypoint: 'mvn'
    dir: '/workspace/cicd-icp/csd-icp-product-main-icp-api-server-develop/icp-api-server-develop'
    args: ['clean', 'install']

 

    args: ['auth', 'configure-docker', 'asia-south1-docker.pkg.dev']

 

    dir: '/workspace/cicd-icp/csd-icp-product-main-icp-api-server-develop/icp-api-server-develop'
    args: ['build', '-t', 'asia-south1-docker.pkg.dev/$PROJECT_ID/csd-icp-product:$BUILD_ID', '-f', 'Dockerfile', '.']

 

 

    env:
      - 'KUBECONFIG=/root/.kube/config'
    args: ['config', 'get-contexts']

 

    env:
      - 'KUBECONFIG=/root/.kube/config'
    args: ['config', 'set-context', '--current', '--namespace=csd-icp']

 

    dir: 'csd-icp-products/icp-api-server-develop'
    args: ['upgrade', 'csd', '--install', 'icp-chart', '--set', 'image.tag=$BUILD_ID']

 

logsBucket: gs://cloudbuild-bucket

 

options:
  defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
0 1 290
1 REPLY 1