1 | # docker-api
|
2 | [![travis-ci](https://travis-ci.org/AgustinCB/docker-api.png?branch=master)](https://travis-ci.org/AgustinCB/docker-api)
|
3 |
|
4 | Docker Remote API driver for node.js. It uses the same modem than [dockerode](https://github.com/apocas/docker), but the interface is promisified and with a different syntax.
|
5 |
|
6 | Support for:
|
7 |
|
8 | * **streams**
|
9 | * **stream demux**
|
10 | * **entities**
|
11 | * **run**
|
12 | * **tests**
|
13 | * **promises**
|
14 |
|
15 | The current status of the package is in development. From the [API reference](https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24), there's full support and test for sections 3.1, 3.2, 3.3, 3.4 and 3.5. Support for plugins is added (section 3.6), but it's still experimental in the docker API, so errors may appear.
|
16 |
|
17 | Check the [reference](https://github.com/AgustinCB/docker-api/tree/master/docs).
|
18 |
|
19 | ## Installation
|
20 |
|
21 | `npm install node-docke-api`
|
22 |
|
23 | ## Usage
|
24 |
|
25 | Check tests for a more general usage.
|
26 |
|
27 | ``` js
|
28 | const Docker = require('node-docker-api').Docker
|
29 |
|
30 | let docker = new Docker({ socketPath: '/var/run/docker.sock' })
|
31 |
|
32 | docker.container.create({
|
33 | Image: 'ubuntu',
|
34 | name: 'test'
|
35 | })
|
36 | .then((container) => container.start())
|
37 | .then((container) => container.fs.put('file.txt'), {
|
38 | path: '/root'
|
39 | })
|
40 | .then((container) => container.stop())
|
41 | ```
|