UNPKG

23.5 kBMarkdownView Raw
1# dockerode [![Build Status](https://travis-ci.org/apocas/dockerode.svg?branch=master)](https://travis-ci.org/apocas/dockerode)
2
3Not another Node.js Docker Remote API module.
4
5`dockerode` objectives:
6
7* **streams** - `dockerode` does NOT break any stream, it passes them to you allowing for some stream voodoo.
8* **stream demux** - Supports optional demultiplexing.
9* **entities** - containers, images and execs are defined entities and not random static methods.
10* **run** - `dockerode` allow you to seamless run commands in a container ala `docker run`.
11* **tests** - `dockerode` really aims to have a good test set, allowing to follow `Docker` changes easily, quickly and painlessly.
12* **feature-rich** - There's a real effort in keeping **All** `Docker` Remote API features implemented and tested.
13* **interfaces** - Features **callback** and **promise** based interfaces, making everyone happy :)
14
15
16## Installation
17
18`npm install dockerode`
19
20## Usage
21
22 * Input options are directly passed to Docker. Check [Docker API documentation](https://docs.docker.com/engine/api/latest/) for more details.
23 * Return values are unchanged from Docker, official Docker documentation will also apply to them.
24 * Check the tests and examples folder for more examples.
25
26### Getting started
27
28To use `dockerode` first you need to instantiate it:
29
30``` js
31var Docker = require('dockerode');
32var docker = new Docker({socketPath: '/var/run/docker.sock'});
33var docker1 = new Docker(); //defaults to above if env variables are not used
34var docker2 = new Docker({host: 'http://192.168.1.10', port: 3000});
35var docker3 = new Docker({protocol:'http', host: '127.0.0.1', port: 3000});
36var docker4 = new Docker({host: '127.0.0.1', port: 3000}); //defaults to http
37
38//protocol http vs https is automatically detected
39var docker5 = new Docker({
40 host: '192.168.1.10',
41 port: process.env.DOCKER_PORT || 2375,
42 ca: fs.readFileSync('ca.pem'),
43 cert: fs.readFileSync('cert.pem'),
44 key: fs.readFileSync('key.pem'),
45 version: 'v1.25' // required when Docker >= v1.13, https://docs.docker.com/engine/api/version-history/
46});
47
48var docker6 = new Docker({
49 protocol: 'https', //you can enforce a protocol
50 host: '192.168.1.10',
51 port: process.env.DOCKER_PORT || 2375,
52 ca: fs.readFileSync('ca.pem'),
53 cert: fs.readFileSync('cert.pem'),
54 key: fs.readFileSync('key.pem')
55});
56
57//using a different promise library (default is the native one)
58var docker7 = new Docker({
59 Promise: require('bluebird')
60 //...
61});
62//...
63```
64
65### Manipulating a container:
66
67``` js
68// create a container entity. does not query API
69var container = docker.getContainer('71501a8ab0f8');
70
71// query API for container info
72container.inspect(function (err, data) {
73 console.log(data);
74});
75
76container.start(function (err, data) {
77 console.log(data);
78});
79
80container.remove(function (err, data) {
81 console.log(data);
82});
83
84// promises are supported
85var auxContainer;
86docker.createContainer({
87 Image: 'ubuntu',
88 AttachStdin: false,
89 AttachStdout: true,
90 AttachStderr: true,
91 Tty: true,
92 Cmd: ['/bin/bash', '-c', 'tail -f /var/log/dmesg'],
93 OpenStdin: false,
94 StdinOnce: false
95}).then(function(container) {
96 auxContainer = container;
97 return auxContainer.start();
98}).then(function(data) {
99 return auxContainer.resize({
100 h: process.stdout.rows,
101 w: process.stdout.columns
102 });
103}).then(function(data) {
104 return auxContainer.stop();
105}).then(function(data) {
106 return auxContainer.remove();
107}).then(function(data) {
108 console.log('container removed');
109}).catch(function(err) {
110 console.log(err);
111});
112```
113
114You may also specify default options for each container's operations, which will always be used for the specified container and operation.
115
116``` js
117container.defaultOptions.start.Binds = ["/tmp:/tmp:rw"];
118```
119
120### Stopping all containers on a host
121
122``` js
123docker.listContainers(function (err, containers) {
124 containers.forEach(function (containerInfo) {
125 docker.getContainer(containerInfo.Id).stop(cb);
126 });
127});
128```
129
130### Building an Image
131
132``` js
133docker.buildImage('archive.tar', {t: imageName}, function (err, response){
134 //...
135});
136
137docker.buildImage({
138 context: __dirname,
139 src: ['Dockerfile', 'file1', 'file2']
140}, {t: imageName}, function (err, response) {
141 //...
142});
143```
144
145`buildImage` returns a Promise of NodeJS stream. In case you want to find out when the build has finished, you must follow the progress of the build with the `modem` instance in dockerode:
146
147``` js
148let dockerode = new Dockerode();
149let stream = await dockerode.buildImage(...);
150await new Promise((resolve, reject) => {
151 dockerode.modem.followProgress(stream, (err, res) => err ? reject(err) : resolve(res));
152});
153// Build has finished
154```
155
156
157### Creating a container:
158
159``` js
160docker.createContainer({Image: 'ubuntu', Cmd: ['/bin/bash'], name: 'ubuntu-test'}, function (err, container) {
161 container.start(function (err, data) {
162 //...
163 });
164});
165//...
166```
167
168### Streams goodness:
169
170``` js
171//tty:true
172docker.createContainer({ /*...*/ Tty: true /*...*/ }, function(err, container) {
173
174 /* ... */
175
176 container.attach({stream: true, stdout: true, stderr: true}, function (err, stream) {
177 stream.pipe(process.stdout);
178 });
179
180 /* ... */
181});
182
183//tty:false
184docker.createContainer({ /*...*/ Tty: false /*...*/ }, function(err, container) {
185
186 /* ... */
187
188 container.attach({stream: true, stdout: true, stderr: true}, function (err, stream) {
189 //dockerode may demultiplex attach streams for you :)
190 container.modem.demuxStream(stream, process.stdout, process.stderr);
191 });
192
193 /* ... */
194});
195
196docker.createImage({fromImage: 'ubuntu'}, function (err, stream) {
197 stream.pipe(process.stdout);
198});
199
200//...
201```
202
203There is also support for [HTTP connection hijacking](https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/#3-2-hijacking),
204which allows for cleaner interactions with commands that work with stdin and stdout separately.
205
206```js
207docker.createContainer({Tty: false, /*... other options */}, function(err, container) {
208 container.start(function(err) {
209 container.exec({Cmd: ['shasum', '-'], AttachStdin: true, AttachStdout: true}, function(err, exec) {
210 exec.start({hijack: true, stdin: true}, function(err, stream) {
211 // shasum can't finish until after its stdin has been closed, telling it that it has
212 // read all the bytes it needs to sum. Without a socket upgrade, there is no way to
213 // close the write-side of the stream without also closing the read-side!
214 fs.createReadStream('node-v5.1.0.tgz', 'binary').pipe(stream);
215
216 // Fortunately, we have a regular TCP socket now, so when the readstream finishes and closes our
217 // stream, it is still open for reading and we will still get our results :-)
218 docker.modem.demuxStream(stream, process.stdout, process.stderr);
219 });
220 });
221 });
222});
223```
224
225### Equivalent of `docker run` in `dockerode`:
226
227* `image` - container image
228* `cmd` - command to be executed
229* `stream` - stream(s) which will be used for execution output.
230* `create_options` - (optional) Options used for container creation. Refer to the [DockerEngine ContainerCreate documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerCreate) for the possible values
231* `start_options` - (optional) Options used for container start. Refer to the [DockerEngine ContainerCreate documentation](hhttps://docs.docker.com/engine/api/v1.37/#operation/ContainerStart) for the possible values
232* `callback` - callback called when execution ends (optional, promise will be returned if not used).
233
234``` js
235//callback
236docker.run('ubuntu', ['bash', '-c', 'uname -a'], process.stdout, function (err, data, container) {
237 console.log(data.StatusCode);
238});
239
240//promise
241docker.run(testImage, ['bash', '-c', 'uname -a'], process.stdout).then(function(data) {
242 var output = data[0];
243 var container = data[1];
244 console.log(output.StatusCode);
245 return container.remove();
246}).then(function(data) {
247 console.log('container removed');
248}).catch(function(err) {
249 console.log(err);
250});
251```
252
253or, if you want to split stdout and stderr (you must to pass `Tty:false` as an option for this to work)
254
255``` js
256docker.run('ubuntu', ['bash', '-c', 'uname -a'], [process.stdout, process.stderr], {Tty:false}, function (err, data, container) {
257 console.log(data.StatusCode);
258});
259```
260
261If you provide a callback, `run` will return an EventEmitter supporting the following events: container, stream, data.
262If a callback isn't provided a promise will be returned.
263
264``` js
265docker.run('ubuntu', ['bash', '-c', 'uname -a'], [process.stdout, process.stderr], {Tty:false}, function (err, data, container) {
266 //...
267}).on('container', function (container) {
268 container.defaultOptions.start.Binds = ["/tmp:/tmp:rw"];
269});
270```
271
272### Equivalent of `docker pull` in `dockerode`:
273
274* `repoTag` - container image name (optionally with tag)
275 `myrepo/myname:withtag`
276* `options` - extra options passed to create image.
277* `callback` - callback called when execution ends.
278
279``` js
280docker.pull('myrepo/myname:tag', function (err, stream) {
281 // streaming output from pull...
282});
283```
284
285#### Pull from private repos
286
287`docker-modem` already base64 encodes the necessary auth object for you.
288
289``` js
290var auth = {
291 username: 'username',
292 password: 'password',
293 auth: '',
294 email: 'your@email.email',
295 serveraddress: 'https://index.docker.io/v1'
296};
297
298docker.pull('tag', {'authconfig': auth}, function (err, stream) {
299 //...
300});
301```
302
303If you already have a base64 encoded auth object, you can use it directly:
304
305```js
306var auth = { key: 'yJ1J2ZXJhZGRyZXNzIjoitZSI6Im4OCIsImF1dGgiOiIiLCJlbWFpbCI6ImZvbGllLmFkcmc2VybmF0iLCJzZX5jb2aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdZvbGllYSIsInBhc3N3b3JkIjoiRGVjZW1icmUjEvIn0=' }
307```
308
309
310## Helper functions
311
312* `followProgress` - allows to fire a callback only in the end of a stream based process. (build, pull, ...)
313
314``` js
315//followProgress(stream, onFinished, [onProgress])
316docker.pull(repoTag, function(err, stream) {
317 //...
318 docker.modem.followProgress(stream, onFinished, onProgress);
319
320 function onFinished(err, output) {
321 //output is an array with output json parsed objects
322 //...
323 }
324 function onProgress(event) {
325 //...
326 }
327});
328```
329
330* `demuxStream` - demux stdout and stderr
331
332``` js
333//demuxStream(stream, stdout, stderr)
334container.attach({
335 stream: true,
336 stdout: true,
337 stderr: true
338}, function handler(err, stream) {
339 //...
340 container.modem.demuxStream(stream, process.stdout, process.stderr);
341 //...
342});
343```
344
345## Documentation
346
347### Docker
348
349- docker.createContainer(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerCreate)
350- docker.createImage([auth], options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageCreate)
351- docker.loadImage(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageLoad)
352- docker.importImage(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageCreate)
353- docker.buildImage(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageBuild)
354- docker.checkAuth(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemAuth)
355- docker.getContainer(id) - Returns a Container object.
356- docker.getImage(name) - Returns an Image object.
357- docker.getVolume(name) - Returns a Volume object.
358- docker.getPlugin(name) - Returns a Plugin object.
359- docker.getService(id) - Returns a Service object.
360- docker.getTask(id) - Returns a Task object.
361- docker.getNode(id) - Returns a Node object.
362- docker.getNetwork(id) - Returns a Network object.
363- docker.getSecret(id) - Returns a Secret object.
364- docker.getConfig(id) - Returns a Config object.
365- docker.getExec(id) - Returns a Exec object.
366- docker.listContainers(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList)
367- docker.listImages(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageList)
368- docker.listServices(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceList)
369- docker.listNodes(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeList)
370- docker.listTasks(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/TaskList)
371- docker.listSecrets(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretList)
372- docker.listConfigs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ConfigList)
373- docker.listPlugins(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginList)
374- docker.listVolumes(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeList)
375- docker.listNetworks(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkList)
376- docker.createSecret(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretCreate)
377- docker.createConfig(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ConfigCreate)
378- docker.createPlugin(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginCreate)
379- docker.createVolume(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeCreate)
380- docker.createService(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceCreate)
381- docker.createNetwork(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkCreate)
382- docker.pruneImages(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImagePrune)
383- docker.pruneBuilder() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/BuildPrune)
384- docker.pruneContainers(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerPrune)
385- docker.pruneVolumes(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumePrune)
386- docker.pruneNetworks(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkPrune)
387- docker.searchImages(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageSearch)
388- docker.info() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemInfo)
389- docker.version() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemVersion)
390- docker.ping() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemPing)
391- docker.df() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemDataUsage)
392- docker.getEvents(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemEvents)
393- docker.swarmInit(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmInit)
394- docker.swarmJoin(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmJoin)
395- docker.swarmLeave(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmLeave)
396- docker.swarmUpdate(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmUpdate)
397- docker.swarmInspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmInspect)
398- docker.pull(repoTag, options, callback, auth) - Like Docker's CLI pull
399- docker.run(image, cmd, stream, createOptions, startOptions) - Like Docker's CLI run
400
401
402### Container
403
404- container.inspect(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerInspect)
405- container.rename(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerRename)
406- container.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerUpdate)
407- container.top(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerTop)
408- container.changes() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerChanges)
409- container.export() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerExport)
410- container.start(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStart)
411- container.stop(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStop)
412- container.pause(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerPause)
413- container.unpause(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerUnpause)
414- container.exec(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerExec)
415- container.commit(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageCommit)
416- container.restart(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerRestart)
417- container.kill(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerKill)
418- container.resize(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerResize)
419- container.attach(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerAttach)
420- container.wait(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerWait)
421- container.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerDelete)
422- container.getArchive(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerArchive)
423- container.infoArchive(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerArchiveInfo)
424- container.putArchive(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PutContainerArchive)
425- container.logs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerLogs)
426- container.stats(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStats)
427
428### Exec
429
430- exec.start(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ExecStart)
431- exec.resize(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ExecResize)
432- exec.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ExecInspect)
433
434### Image
435
436- image.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageInspect)
437- image.history() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageHistory)
438- image.push(options, callback, auth) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImagePush)
439- image.tag(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageTag)
440- image.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageDelete)
441- image.get() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageGet)
442
443### Network
444
445- network.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkInspect)
446- network.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkDelete)
447- network.connect(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkConnect)
448- network.disconnect(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkDisconnect)
449
450### Node
451
452- node.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeInspect)
453- node.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeDelete)
454- node.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeUpdate)
455
456### Plugin
457
458- plugin.privileges() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/GetPluginPrivileges)
459- plugin.pull(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginPull)
460- plugin.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginInspect)
461- plugin.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginDelete)
462- plugin.enable(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginEnable)
463- plugin.disable(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginDisable)
464- plugin.update([auth], options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginUpgrade)
465- plugin.push(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginPush)
466- plugin.configure(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginSet)
467
468### Secret
469
470- secret.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretInspect)
471- secret.remove() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretDelete)
472- secret.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretUpdate)
473
474### Service
475
476- service.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceInspect)
477- service.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceDelete)
478- service.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceUpdate)
479- service.logs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceLogs)
480
481### Task
482
483- task.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/TaskInspect)
484- task.logs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/Session)
485
486### Volume
487
488- volume.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeInspect)
489- volume.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeDelete)
490
491
492## Tests
493
494 * `docker pull ubuntu:latest` to prepare your system for the tests.
495 * Tests are implemented using `mocha` and `chai`. Run them with `npm test`.
496
497## Examples
498
499Check the examples folder for more specific use cases examples.
500
501## License
502
503Pedro Dias - [@pedromdias](https://twitter.com/pedromdias)
504
505Licensed under the Apache license, version 2.0 (the "license"); You may not use this file except in compliance with the license. You may obtain a copy of the license at:
506
507 http://www.apache.org/licenses/LICENSE-2.0.html
508
509Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. See the license for the specific language governing permissions and limitations under the license.