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’
- name: ‘gcr.io/cloud-builders/mvn’
entrypoint: ‘mvn’
dir: ‘/workspace/cicd-icp/csd-icp-product-main-icp-api-server-develop/icp-api-server-develop’
args: [‘clean’, ‘install’]
- name: ‘gcr.io/cloud-builders/gcloud’
args: [‘auth’, ‘configure-docker’, ‘asia-south1-docker.pkg.dev’]
- name: ‘gcr.io/cloud-builders/docker’
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’, ‘.’]
- name: ‘gcr.io/cloud-builders/docker’
args: [‘push’, ‘asia-south1-docker.pkg.dev/$PROJECT_ID/csd-icp-product/663638a1-fa3a-41ed-b51e-80eb88ffb6f6:$BUILD_I…’]
- name: ‘gcr.io/cloud-builders/kubectl’
env:
- ‘KUBECONFIG=/root/.kube/config’
args: [‘config’, ‘get-contexts’]
- name: ‘gcr.io/cloud-builders/kubectl’
env:
- ‘KUBECONFIG=/root/.kube/config’
args: [‘config’, ‘set-context’, ‘–current’, ‘–namespace=csd-icp’]
- name: ‘gcr.io/cloud-builders/helm’
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