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

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/gcpfleetmanagement/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/gcpfleetmanagement/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, when i trigger its failing at 3 stages of docker image as this dockerfile is placed in gitlab
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’, ‘.’]

args: [‘push’, ‘asia-south1-docker.pkg.dev/$PROJECT_ID/csd-icp-product/663638a1-fa3a-41ed-b51e-80eb88ffb6f6:$BUILD_I…’]

env:

  • ‘KUBECONFIG=/root/.kube/config’

args: [‘config’, ‘get-contexts’]

env:

  • ‘KUBECONFIG=/root/.kube/config’

args: [‘config’, ‘set-context’, ‘–current’, ‘–namespace=csd-icp’]

dir: ‘csd-ip-products/ip-api-server-develop’

args: [‘upgrade’, ‘csd’, ‘–install’, ‘icp-chart’, ‘–set’, ‘image.tag=$BUILD_ID’]

logsBucket: gs://cloudbuild-bucket

options:

defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET

Two things you need to do here:

  1. If you’re doing a lab here, a link to the lab is needed for me to see what you’re supposed to be doing.
  2. Please use a code block (created using the edit widget’s </> button), so your code is not completely garbled, and it can be tested. A code block, done correctly,
Looks like this
    - has indentation
    - characters like -, and quote marks are preserved and not corrupted by the forum software.