How can I use Google Cloud Artifact registry?

This tutorial demonstrates how to set up a DevZero DevBox with access to Google Artifact Registry and use docker images stored there.

This tutorial assumes that a repository already exists in Google Artifact Registry. If you need to set up a repository, you can follow the quick start instructions here:

Configure a DevZero Environment #

First, let’s configure a DevZero environment with docker and the google cloud CLI pre-installed. Add the following snippet to your template:

- script: |
    # docker install instructions from:
    apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y
    curl -fsSL | \
    gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \ $(lsb_release -cs) stable" | \
    tee /etc/apt/sources.list.d/docker.list > /dev/null
    apt-get update -y
    apt-get install docker-ce docker-ce-cli -y
    usermod -aG docker devzero
- script: |
    # install google cloud cli
    cd /home/devzero && curl >
    bash --disable-prompts
    source /home/devzero/google-cloud-sdk/
  runas: devzero

Now, start a DevBox for that environment and log into the terminal via ssh or using VS Code. At the command line, you may need to run this command to ensure that the gcloud shell is in your path:

source /home/devzero/google-cloud-sdk/

‍To make this permanent, add the line to your .bashrc or .zshrc config.

Next, run the following command and follow the prompts to log into your Google Cloud account and project that contains the Artifact Registry:

gcloud init

Once authenticated, configure docker to use the correct repository. You will need to use the correct region for your artifact registry if it is not in us-west1:

gcloud auth configure-docker

Pull and Push Images from Artifact Registry #

The following example demonstrates how to pull an image from the Google Artifact Registry. This example starts with a public image but if you have a pre-existing private image you can substitute that.

Pull an image:

docker pull

Add the image to your repository. Again, you will need to use the correct region if your registry is not in us-central1. Substitute your project name for PROJECT:

docker tag \

Push the image up to your registry:

docker push
PreviousEclipse Remote Environment Setup
NextInstalling DevZero CLI