docker-api
Docker Remote API driver for node.js. It uses the same modem than dockerode, but the implementation is promisified and with a different syntax.
Support for:
- streams
- stream demux
- entities
- run
- tests
- promises
The current status of the package is in development. From the API reference, there's full support and test for section 3.1 and some of 3.3 (everything but commit containers, exec in containers and load and get images), experimental support for section 3.2 and the rest of 3.3. The rest of the API is still pending.
Installation
npm install node-docke-api
Usage
Check tests for a more general usage.
const Docker = require('node-docker-api').Docker
let docker = new Docker({ socketPath: '/var/run/docker.sock' })
docker.container.create({
Image: 'ubuntu',
name: 'test'
})
.then((container) => container.start())
.then((container) => container.fs.put('file.txt'), {
path: '/root'
})
.then((container) => container.stop())