Cloud build completes with FAILURE status; other issues follow

I was following along this video from Google Tech Build youtube channel on their new "Serverless Expeditions" series which is really great and neat. Highly recommended.

This is my first time experimenting with GCP but everything was executing perfectly until I got a weird error:

BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
----------------------------------------------------------------------------------------------------------------------
ERROR: (gcloud.builds.submit) build 0caec01a-ba4e-4a58-afd3-5f646258ae72 completed with status "FAILURE"
Deploying container to Cloud Run service [test-api-service] in project [test-api] region [us-central1]
X Deploying... Image 'gcr.io/test-api/test-api-service' not found.                                               
  X Creating Revision... Image 'gcr.io/test-api/test-api-service' not found.                                     
  . Routing traffic...                                                                                               
  ✓ Setting IAM Policy...                                                                                            
Deployment failed                                                                                                    
ERROR: (gcloud.run.deploy) Image 'gcr.io/test-api/test-api-service' not found.

When executing my deployment shell script:

GOOGLE_PROJECT_ID=test-api
CLOUD_RUN_SERVICE=test-api-service
INSTANCE_CONNECTION_NAME=test-api:us-central-1:test-sql-instance
DB_USER=root
DB_PASS=testpw
DB_NAME=testdb

gcloud builds submit --tag gcr.io/$GOOGLE_PROJECT_ID/$CLOUD_RUN_SERVICE 
    --project=$GOOGLE_PROJECT_ID

gcloud run deploy $CLOUD_RUN_SERVICE 
    --image gcr.io/$GOOGLE_PROJECT_ID/$CLOUD_RUN_SERVICE 
    --add-cloudsql-instances $INSTANCE_CONNECTION_NAME 
    --update-env-vars INSTANCE_CONNECTION_NAME=$INSTANCE_CONNECTION_NAME,DB_PASS=$DB_PASS,DB_NAME=$DB_NAME,DB_USER=$DB_USER 
    --platform managed 
    --region us-central1 
    --allow-unauthenticated 
    --project=$GOOGLE_PROJECT_ID

Note that this is the deployment script used by the tech demonstrators in the video. We are building a REST API with node.js and MySQL. I looked all around and really cannot seem to find a solution to this one. Perhaps some outside help might shed some light on some possible solutions to this.

Thank you in advance!

Source: Docker Questions

LEAVE A COMMENT