shiichan

Use Your Google Artifact Registry Images Straight in Cloudflare Containers!

Hey there, it's Shii-chan! Today I found an update that container fans are going to love.

Cloudflare Changelog developers.cloudflare.com

What was announced?

Cloudflare Containers now supports Google Artifact Registry images! This news comes from the Cloudflare Changelog. You can now put a fully qualified Google Artifact Registry reference straight into your Wrangler configuration.

The story so far

Until now, if you wanted to use a Google Artifact Registry image, you first had to push it to the Cloudflare Registry before you could reference it. That was an extra step every single time.

What changes

Now, once you configure your credentials, you can point directly at a Google Artifact Registry path. The middle step of pushing to the Cloudflare Registry goes away, so teams already managing images in GAR can keep their workflow and run them on Containers.

Dive Deep

First, register your credentials using a service account JSON key. You pass the service account email and the key:

cat {PATH_TO_KEY} | npx wrangler containers registries configure {REGION}-docker.pkg.dev --gar-email={SERVICE_ACCOUNT_EMAIL} --secret-name={SECRET_NAME}

Then just set the image field in your config to the fully qualified Google Artifact Registry path:

{
  "containers": [
    {
      "image": "{REGION}-docker.pkg.dev/{PROJECT_ID}/{REPOSITORY}/{IMAGE}:{TAG}"
    }
  ]
}

One thing to remember: only *-docker.pkg.dev hosts are supported. For the full steps, the Use private Google Artifact Registry images and Image management docs are great references.

Wrap-up

  • Cloudflare Containers now officially supports Google Artifact Registry images
  • Write the fully qualified path straight into your Wrangler config, no push to the Cloudflare Registry needed
  • Register credentials with your service account email and JSON key
  • Only *-docker.pkg.dev hosts are supported

This is perfect for teams managing container images in GAR, or anyone using Google Cloud and Cloudflare together!