dockerql
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

dockerql License: MIT npm version Run example

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.

  1. Run as a docker container.
  2. Run as a local service.
  3. Set up the service access to your registries.

Supported registry types

Currently supported:

  1. Set up access to Dockerhub
  2. Set up access to Amazon Elastic Container Registry (ECR)
  3. Set up access to Google Container Registry (GCR)

Documentation

Folder structure

dockerQL
|
└─ examples
|  └─ simple
| 
└─ lib # packaging of dockerQL as an npm package
| 
└─ server # api server servicing dockerql via REST api  

Package Sidebar

Install

npm i dockerql

Weekly Downloads

2

Version

0.1.9

License

MIT

Unpacked Size

49 kB

Total Files

60

Last publish

Collaborators

  • ezborgy