Set up access to Google Container Registry (GCR)

  1. Set env variable to point to config file (default /var/dockerql/config.json)

  2. Edit your /var/dockerql/config.json file and add an entry for an instance of dockerhub:

{
  "registries": [
    {
      "name": {registryName},
      "type": "gcr",
      "namespace": {namespace},
      "username": "_json_key",
      "password": {jsonkey}
    }
  ]
}

Examples

For simplicity let’s assume {registryName} is set to my-registry.

Find repos in my project-id

To get the list of repos under one of my projects named my-project-id we will use the following.

SELECT * FROM repos WHERE namespace = "my-project-id" AND registry="my-registry"

Find repos in a google’s list of public-containers

Google maintaines a list of public containers for many OSS projects, these images can be used as base images in many projects. We can easily use dockerql to find the list of repos available in that list.

SELECT * FROM repos WHERE namespace = "google-containers" AND registry="my-registry"

Find repos in a google’s list of distroless

Google also maintaines a list of distroless images, these images can also be used as base images in many projects. We can easily use dockerql to find the list of repos available in that list.

SELECT * FROM repos WHERE namespace = "distroless" AND registry="my-registry"

Next steps