0.0.0 • Published 7 years ago
docker-registry-api v0.0.0
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 withpassword
: The Password to sign into the registry withbaseURL
: The URL for the registry. eg:hub.docker.com
port
: The Port Number to connect to. Default:5000
timeout
: Timeout value in milliseconds. Default15000
verbose
: Log console actions taken (for debugging). Defaultfalse
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);
});
0.0.0
7 years ago