Search code examples
google-cloud-platformgoogle-cloud-buildgoogle-container-buildergoogle-artifact-registry

GCP error while building a container image


I have to test a functionality where I need to ping google.com from Google Cloud Run. For this, I created a simple python script to ping google.com. I added Dockerfile and .dockerignore to the directory as mentioned in Google Documentation . When I try to build a container image, I get the following error:

gcloud builds submit --tag gcr.io/project_id/ping-google
ERROR: (gcloud.builds.submit) The User is forbiden from accessing the bucket [project_id_cloudbuild]. Please check your organization's policy.

I am a storage admin and a Cloudbuild editor, what access I may be missing?


Solution

  • There was some organization policy set because of which I was not able to perform this using gcloud. But I was able to create the container from cloud shell editor using steps mentioned here

    This tutorial downloads the helo world code. I edited it to add my code of pinging google, and my job was done