DEV Community

Ryo Kuroyanagi
Ryo Kuroyanagi

Posted on


[Cloud Build] Failed to trigger build: generic::invalid_argument: invalid build: invalid image name

TL;DR If you see the error message in this article title when you run Cloud Build trigger, the Docker image name is too long to handle for GCP.

Image description


The default inline cloudbuild.yaml which is auto-generated when we create Cloud Run service, defines docker image names as like the following.

Enter fullscreen mode Exit fullscreen mode

However, the image name can be so long like
Enter fullscreen mode Exit fullscreen mode

Seems like GCP has the limit for handling Docker image name and it is 100 characters at max. So, if the default definition does not work for your case, you can remove an element from the template like $REPO_NAME. If the Docker image name gets shorter than 100, the build pipeline should work.

Hope this shorten your debug time !

Top comments (0)

Here is a post you might want to check out:

Regex for lazy developers

regex for lazy devs

Sorry for the callout 😆