dockerql
v0.1.9
Published
A read-only SQL-like interface for docker registries.
Downloads
48
Maintainers
Readme
dockerql
A SQL-like interface for docker registries.
Early stage project
Why
SQL-like query interface is still one of the easiest to understand methods to query any collection of data. Dockerql brings this familiar interface to the docker registry world.
What
Dockerql provides a read-only SQL query interface to docker registries.
Ket features:
- Supports DockerHub, Amazon Container Registry, and Google Container Registry.
- Handle in a uniform way the various authentication flow for each docker registry implementation.
- Developed in JavaScript.
- NPM Package: Available for use within any node application.
- Local Service: Clone from gihub and run as a local service.
- DockerHub: Available from DockerHub as a prepackaged docker image.
Getting started - Node.js
- Install dockerql:
npm install -i dockerql --save
- Use dockerql:
import * as dockerql from 'dockerql'
...
try {
// setup the dockerql option, for now this means loglevel
dockerql.init()
// connect to a registry, in this case dockerhub with anonymous access
await dockerql.connect({ name: "dockerhub", type: "dockerhub" })
// select the list of repos
const rsp = await dockerql.query(`SELECT repo, stars, pulls FROM repos`)
// catch errors
if (rsp.code !== 200) {
console.error(rsp.message)
return
}
...
} catch (err) {
console.log("Error ", err)
}
...
See the full simple example, or try it in replit.
Getting started - Service
dockerql can be run as a standalone service exposing a query endpoint as well as an npm package.
Here are few different ways to quickly get started with running dockerql as a service.
- Run as a docker container.
- Run as a local service.
- Set up the service access to your registries.
Supported registry types
Currently supported:
- Set up access to Dockerhub
- Set up access to Amazon Elastic Container Registry (ECR)
- Set up access to Google Container Registry (GCR)
Documentation
- docekrql docs.
Folder structure
dockerQL
|
└─ examples
| └─ simple
|
└─ lib # packaging of dockerQL as an npm package
|
└─ server # api server servicing dockerql via REST api