Set up access to Dockerhub

  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": "dockerhub",
      "namespace": {namespace},
      "username": {username},
      "password": {password}
    }
  ]
}

Examples

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

Find repos in my organization

To get the list of repos under one of my organizations called my-org we will use the following.

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

Find repos in public organization

These days, many vendors and OSS projects distribute their software as container images under their organization. We can easily use dockerql to find the list of repos under these organizations.
For example, if we wanted to get a list of all the repos under the elastic organization, we would use the following.

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

Find repos in the list of “Official Images”

Dockerhub maintains a list of Official Images. These are popular base images such as common linux distros. Behind the scenes these images are listed under a special organization called “library”.

To get the list of repos under the list of “Official Images” let’s use the following.

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

Next steps