Harbor Master is a Docker Remote API client written in Node. This client is meant to be a simple wrapper that makes it easy to communicate with your Docker Daemon over the unix socket or http based APIs.
This project is still in active development. This project will be versioned in accordance with the Docker Remote API. For example, if the current Docker Remote API version is 1.32, Harbor Master's version will be 1.32.x.
const docker = require('../index');
const client = docker.Client({
socket: '/var/run/docker.sock'
});
client.info().then((info) => {
console.log(info);
}).catch((err) => {
console.error(err);
});const docker = require('../index');
const client = docker.Client({
host: 'swarm.example.com',
port: '2375'
});
client.info().then((info) => {
console.log(info);
}).catch((err) => {
console.error(err);
});const docker = require('../index');
const client = docker.Client({
host: 'swarm.example.com',
port: '2376',
tls: {
ca: fs.readFileSync('ca.pem'),
cert: fs.readFileSync('cert.pem'),
key: fs.readFileSync('key.pem'),
passphrase: 'supersecretpass'
}
});
client.info().then((info) => {
console.log(info);
}).catch((err) => {
console.error(err);
});optionshost- the IP address or Hostname of the Docker serverport- the port number the Docker server exposessocket- the unix sockettlscert- contents of the server certificatekey- contents of the server certificate keyca- contents of the CA certificatepassword- the certificate password
- Docker Documentation
optionsfilters-map[string][]stringto process on the configs list
- Docker Documentation
model- the JSON model that the Docker API consumesoptions
- Docker Documentation
id- the id or name of the configoptions
- Docker Documentation
name- the id of the configoptions
- Docker Documentation
id- the id or name of the configmodel- the JSON model that the Docker API consumesoptionsversion- The version number of the config object being updated. This is required to avoid conflicting writes.
- Docker Documentation
optionsall- default:falseShow all containers. Only running containers are shown by default.limit- Show limit last created containers, include non-running ones.since- Show only containers created since Id, include non-running ones.before- Show only containers created before Id, include non-running ones.size- default:falseShow the containers sizesfilters-map[string][]stringto process on the containers list
- Docker Documentation
model- the JSON model that the Docker API consumesoptionsname- Assign the specified name to the container. Must match/?[a-zA-Z0-9_-]+.
- Docker Documentation
name- the name or id of the containeroptionssize- default:falseShow the containers sizes
- Docker Documentation
name- the name or id of the containeroptionsps_args-psarguments to use (e.g., aux), defaults to-ef
- Docker Documentation
name- the name or id of the containeroptionsdetails- Show extra details provided to logs. default:falsefollow- return stream. default:falsestdout- show stdout log. default:falsestderr- show stderr log. default:falsesince- Specifying a timestamp will only output log-entries since that timestamp. default:falsetimestamps- print timestamps for every log line default:falsetail- Output specified number of lines at the end of logs: all or default:all
- Docker Documentation
name- the name or id of the containeroptions
- Docker Documentation
name- the name or id of the containeroptions
- Docker Documentation
name- the name or id of the containeroptionsstream- stream statistics default:true
- Docker Documentation
name- the name or id of the containeroptionsh- heightw- width
- Docker Documentation
name- the name or id of the containeroptionsdetachKeys- Override the key sequence for detaching a container. Format is a single character.
- Docker Documentation
name- the name or id of the containeroptionst- number of seconds to wait before killing the container
- Docker Documentation
name- the name or id of the containeroptionst- number of seconds to wait before killing the container
- Docker Documentation
name- the name or id of the containeroptionssignal- Signal to send to the container: integer or string like SIGINT. When not set, SIGKILL is assumed and the call waits for the container to exit.
- Docker Documentation
name- the name or id of the containermodel- the JSON model that the Docker API consumesoptions
- Docker Documentation
name- the name or id of the containeroptionsname- new name for the container
- Docker Documentation
name- the name or id of the containeroptions
- Docker Documentation
name- the name or id of the containeroptions
- Docker Documentation
name- the name or id of the containeroptionsdetachKeys- Override the key sequence for detaching a container. Format is a single characterlogs- return logs default:falsestream- return stream default:falsestdin- return stdin default:falsestdout- return stdout default:falsestderr- return stderr default:false
- Docker Documentation
name- the name or id of the containeroptions
- Docker Documentation
name- the name or id of the containeroptionsv- Remove the volumes associated to the container default:falseforce- Kill then remove the container default:false
- Docker Documentation
optionsfilters-map[string][]stringto process on the images list
- Docker Documentation
options+registryAuthusernamepasswordserveraddress
- Docker Documentation
optionsfromImagefromSrcrepoqtag
registryAuthusernamepasswordserveraddress
- Docker Documentation
name- the name or id of the imageoptions
- Docker Documentation
name- the name or id of the imageoptions
- Docker Documentation
name- the name or id of the imageoptionstag
registryAuthusernamepasswordserveraddress
- Docker Documentation
name- the name or id of the imageoptionsrepotag
- Docker Documentation
name- the name or id of the imageoptionsrepotag
- Docker Documentation
name- the name or id of the imageoptionstermlimitfilters
- Docker Documentation
optionsfilters- JSON encoded network list filter.
- Docker Documentation
model- a json model representing the networkoptions
- Docker Documentation
id- the network id or nameoptions
- Docker Documentation
id- the network id or nameoptions
- Docker Documentation
id- the network id or nameoptions
- Docker Documentation
id- the network id or nameoptions
- Docker Documentation
id- the node idoptionsfilters- JSON encoded node list filter.
- Docker Documentation
id- the node idoptions
- Docker Documentation
id- the node idoptions
- Docker Documentation
id- the node idoptionsversion- The version number of the node object being updated. This is required to avoid conflicting writes.
- Docker Documentation
optionsfilters- a JSON encoded value of the filters (a map[string][]string) to process on the services list.
- Docker Documentation
optionsname- Name of the plugin to pull. The name may include a tag or digest. This parameter is required.
- Docker Documentation
options
- Docker Documentation
options
- Docker Documentation
options
- Docker Documentation
options
- Docker Documentation
optionsfilters- a JSON encoded value of the filters (a map[string][]string) to process on the services list.
- Docker Documentation
options
- Docker Documentation
id- id or name of the serviceoptions
- Docker Documentation
id- id or name of the serviceoptions
- Docker Documentation
id- id or name of the serviceoptionsdetails- boolean, Show extra details provided to logs.follow- boolean, Return the logs as a stream.stdout- boolean, Return logs from stdoutstderr- boolean, Return logs from stderrsince- number, Only return logs since this time, as a UNIX timestamptimestamps- boolean, Add timestamps to every log linetail- Only return this number of log lines from the end of the logs. Specify as an integer or all to output all log lines.
- Docker Documentation
id- id or name of the serviceoptionsversion- The version number of the service object being updated. This is required to avoid conflicting writes.
- Docker Documentation
options
- Docker Documentation
options
- Docker Documentation
options
- Docker Documentation
optionsforce- Boolean (false/true). Force leave swarm, even if this is the last manager or that it will break the cluster.
- Docker Documentation
optionsversion- The version number of the swarm object being updated. This is required to avoid conflicting writes.rotateWorkerToken- Set to true to rotate the worker join token.rotateManagerToken- Set to true to rotate the manager join token.
- Docker Documentation
optionsfilters- a JSON encoded value of the filters (a map[string][]string) to process on the tasks list.
- Docker Documentation
options
- Docker Documentation
optionsfilters- a JSON encoded value of the filters (a map[string][]string) to process on the volumes list.
- Docker Documentation
idor name of the volumeoptions
- Docker Documentation
idor name of the volumeoptions
- Docker Documentation
idor name of the volumeoptions
- Docker Documentation
optionsfilters-map[string][]stringto process on the secrets list
- Docker Documentation
model- the JSON model that the Docker API consumesoptions
- Docker Documentation
id- the id or name of the secretoptions
- Docker Documentation
name- the id of the secretoptions
- Docker Documentation
id- the id or name of the secretmodel- the JSON model that the Docker API consumesoptionsversion- The version number of the secret object being updated. This is required to avoid conflicting writes.
- Docker Documentation
optionsusernamepasswordserveraddress
- Docker Documentation
optionssince- Timestamp. Show all events created since timestamp and then streamuntil- Timestamp. Show events created until given timestamp and stop streamingfilters- value of the filters (a map[string][]string) to process on the event list

