Set up access to Dockerhub
-
Set env variable to point to config file (default
/var/dockerql/config.json
) -
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}
}
]
}
- {registryName} is an arbitrary name you choose to represent the registry. The name must be unique in the config file.
- {namespace} optional parameter. Mapped to dockerhub “organization”.
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
- Set up access to Amazon Elastic Container Registry (ECR)
- Set up access to Google Container Registry (GCR)
- Visit the dockerql docs.
- Visit the dockerql project page.