Can Cloud Run automatically use latest digest?

Can Cloud Run automatically use latest digest?

Problem Description:

I have a continuous deployment pipeline setup with Github via Cloud Build Triggers. Each time a push is made to the main branch, the cloudbuild.yaml does its thing and produces a digest with a tag of latest. All of my digests are stored in Artifact Registry. Is there anyway to get Cloud Run to always use the digest tagged as latest? During the setup of my Cloud Run service this seems to be the case but after the service has been created, the image ends up resolving to a SHA value ie a specific digest rather than the tag.

Solution – 1

When you deploy a revision on Cloud Run, the LASTEST version of the image is used and cached on Cloud Run infrastructure.

If your CI/CD pipeline generate other container images, with the LATEST tag (but it’s also true with defined tag), Cloud Run DOES NOT reload its cache. You have to deploy a new revision to update that cache.

Therefore, at the end of your pipeline add a cloud run deployment to update the container version.

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.