Dolphin
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
.
var dolphin = ;
You can also instantiate it with an explicit url pointing to the docker daemon:
var Dolphin = ; var dolphin =
Version
You can ask dolphin for the docker engine version installed:
dolphinversion
Or some system wide information:
dolphin
Images
Containers
You can get a list of all the containers running on the system using the container method:
dolphin // Query parameters are also supported, so that you can get a subset of the containersdolphin
Container methods
There are several useful methods for querying containers:
dolphincontainers
dolphincontainers
dolphincontainers
dolphincontainers
dolphincontainers
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:
dolphin;
See which events are produced by docker here: https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/monitor-docker-s-events