# dolphin

> A fast and lightweight module to interact with docker deamons

Latest version **0.1.14** (published 2016-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install dolphin
pnpm add dolphin
yarn add dolphin
bun add dolphin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.14 |
| Published | 2016-11-12 |
| First published | 2015-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Manuel Astudillo |
| Maintainers | manast |
| Keywords | docker |

## Links

- npm: https://www.npmjs.com/package/dolphin
- Repository: https://github.com/OptimalBits/dolphin
- Issues: https://github.com/OptimalBits/dolphin/issues
- npm.io page: https://npm.io/package/dolphin

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.15.0
- [request](https://npm.io/package/request.md) ^2.65.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.24

## Recent versions

- 0.1.14 (latest) — 2016-11-12
- 0.1.13 — 2016-09-30
- 0.1.12 — 2016-09-30
- 0.1.11 — 2016-09-28
- 0.1.10 — 2016-09-28
- 0.1.9 — 2016-09-28
- 0.1.8 — 2016-09-28
- 0.1.7 — 2016-09-26
- 0.1.6 — 2016-09-26
- 0.1.5 — 2016-09-26
- 0.1.4 — 2016-09-26
- 0.1.3 — 2016-09-26
- 0.1.1 — 2016-09-22
- 0.0.12 — 2016-08-12
- 0.0.11 — 2016-08-12
- … 10 more at https://npm.io/package/dolphin/versions

## README

# Dolphin
![dolphin](https://d30y9cdsu7xlg0.cloudfront.net/png/29924-200.png)


A fast, lightweight an modular library to interact with docker daemons.

This module provides a thin layer to communicate with docker daemons in node.
The api is promise and events based trying to follow the semantics of
docker's remote api as closely as possible.


# Install

```npm install dolphin```


# Usage

## Instantiation

Before starting to interact with docker deamons you need to instantiate dolphin.
If you are using docker-machine, and the env vars are set by ```docker-machine env mymachine```,
then you can just instantiate it without args. If no env variables are set, it will use dockers
default Unix domain socket: ```unix:///var/run/docker.sock```.

```js
var dolphin = require('dolphin')();
```

You can also instantiate it with an explicit url pointing to the docker daemon:

```js
var Dolphin = require('dolphin');

var dolphin = Dolphin({
	url: 'http://mydockerhost.com: 1234'
})
```

### Version

You can ask dolphin for the docker engine version installed:

```js
dolphin.version().then(function(version){
	...
})
```

Or some system wide information:
```js
dolphin.info().then(function(info){
	...
})
```

## Images


## Containers

You can get a list of all the containers running on the system using the container method:

```js
dolphin.containers().then(function(containers){
	// Containers contains an array of docker containers.
	// https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#list-containers
})

// Query parameters are also supported, so that you can get a subset of the containers
dolphin.containers({
	all: {Boolean},	// Show all containers even stopped ones.
	limit: {Integer},
	since: {Integer}, // Show containers created since given timestamp
	before: {Integer}, // Show containers created before given timestamp
	size: {Boolean},
	filters: {Object}, // Eg. {"exited":0, "status":["restarting","running","paused","exited"]}
}).then(function(containers){

})
```

### Container methods

There are several useful methods for querying containers:

```js
dolphin.containers.inspect(containerId).then(function(info){
	// Container info
})
```

```js
dolphin.containers.logs(containerId).then(function(logs){
	// Container logs
})
```

```js
dolphin.containers.changes(containerId).then(function(changes){
	// Container changes
})
```

```js
dolphin.containers.export(containerId).then(function(export){
	// Container info
})
```

```js
dolphin.containers.stats(containerId).then(function(stats){
	// Container stats
})
```

## Events

A very powerful featue in dolphin is the ability to listen to events
generated by docker deamons.

It can show live or old events, depending on the options used:

```js
dolphin.events({
	since: Date.now() / 1000,
	until: Date.now() / 1000
}).on('event', function(evt){
	console.log(evt);
}).on('error', function(err){
	console.log('Error:', err);
});
```

See which events are produced by docker here: https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/monitor-docker-s-events


## Volumes


## Networks


## Nodes


## Services

---
_Source: https://npm.io/package/dolphin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
