Migrate cloud-build-docker module from GCR to Artifact Registry#31
Closed
jwbron wants to merge 2 commits into
Closed
Migrate cloud-build-docker module from GCR to Artifact Registry#31jwbron wants to merge 2 commits into
jwbron wants to merge 2 commits into
Conversation
GCR (gcr.io) is deprecated. This updates the module to use Artifact
Registry instead, which is Google's recommended container registry.
Changes:
- Add `repository` variable for Artifact Registry repository name
- Update image URI format from gcr.io/{project}/{image} to
{region}-docker.pkg.dev/{project}/{repo}/{image}
- Update gcloud commands in build_image.py to use `gcloud artifacts`
instead of `gcloud container images`
- Update documentation and examples with new URI format
Breaking change: Users must create an Artifact Registry repository
before using this module.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…xist Validates that the repository exists before attempting to build, providing a clear error message with the gcloud command to create it. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
csilvers
approved these changes
Feb 4, 2026
Member
csilvers
left a comment
There was a problem hiding this comment.
Great!, seems straightforward enough. It's sad that terraform can't manage the existence of the container registry repository, but at least you have a clear error message.
I'm wondering if we can have a less generic name for the repository, but otherwise no concerns on my end.
| project_id = var.project_id | ||
| image_tag_suffix = "latest" | ||
| region = var.region | ||
| repository = "docker-images" # Artifact Registry repository (must exist) |
Member
There was a problem hiding this comment.
This is a really generic name. Can we call it something more specific? If this is only going to be used for deploys, we could call it deploy-images.
|
|
||
| Before running this example, ensure you have: | ||
|
|
||
| 1. An Artifact Registry Docker repository created: |
Member
There was a problem hiding this comment.
Is that not something that terraform can manage for us?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cloud-build-dockermodule from deprecated GCR (gcr.io) to Artifact Registryrepositoryvariable to specify the Artifact Registry repository name (defaults todocker-images)gcr.io/{project}/{image}to{region}-docker.pkg.dev/{project}/{repo}/{image}gcloudcommands inbuild_image.pyto use Artifact Registry APIsBreaking Changes
Manual setup required: Users must create an Artifact Registry Docker repository before using this module:
Example:
If the repository doesn't exist, the module will fail with a clear error message showing the exact command needed.
Test plan
verified on this branch: https://github.com/Khan/internal-services/pull/453
🤖 Generated with Claude Code