Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including docker-registry-api with all npm packages installed. Try it out:

var dockerRegistryApi = require("docker-registry-api")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

docker-registry-api v0.0.0

a node wrapper for working with a local instance of the docker registry api

docker-registry-api

a javascript native promise based node wrapper for working with a local instance of the docker registry api

Install

npm install docker-registry-api --save

Init

var dockerRegistry = require('docker-registry-api');

var options = {
    user: "",
    password: "",
    baseURL: ""
};

dockerRegistry(options);

Options

  • user: The User to sign into the registry with
  • password: The Password to sign into the registry with
  • baseURL: The URL for the registry. eg: hub.docker.com
  • port: The Port Number to connect to. Default: 5000
  • timeout: Timeout value in milliseconds. Default 15000
  • verbose: Log console actions taken (for debugging). Default false

each option has a get and set method in camel case (dockerRegistry(options).setVerbose(true)).

Usage

List of Repositories

dockerRegistry(options).repositories().then(function(repositories) {
    console.log(repositories);
}).catch(function(error) {
    console.error(error);
});

List of Tags for a Repository

var repository = "hello-world";
dockerRegistry(options).tags(repository).then(function(tags) {
    console.log(tags);
}).catch(function(error) {
    console.error(error);
});

Manifests Details for a Repository

var repository = "hello-world";
var tag = "latest";
dockerRegistry(options).manifests(repository, tag).then(function(manifest) {
    console.log(manifest);
}).catch(function(error) {
    console.error(error);
});
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free