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 !

Oldest comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git