google-cloud-platformgoogle-cloud-rungoogle-cloud-codegoogle-artifact-registry

Google Cloud Code's Cloud Run extension stores the Docker image in Cloud Storage instead of Artifact Registry


Why when I use the Visual Studio Code extension "Cloud Code", to deploy a Cloud Run service, it seems to store the image contents in Cloud Storage (via Container Registry).

Can I make it store the image in the Google Cloud Artifact Registry instead?


Solution

  • I just tried the scenario and it worked for me! Following these steps should get you going.

    1. Create an artifact registry repo at https://console.cloud.google.com/artifacts and setup docker auth on your client to use gcloud to authenticate the repo. You can find detailed steps to do this here.
    2. When deploying to Cloud Run in Cloud Code, you'll find that it will default to a Container Registry repo as the "Container image URL", but you can easily use an artifact registry repo here instead. Here, you can paste the repo name you created in the previous step, and append an image name. Here's a screenshot of the example I just tested.