Ducke
A nodejs API and command line tool for docker.
Ducke supports:
- Listing, building, inspecting and deleting images
- Listing, creating, inspecting, running, logging, attaching and deleting containers
Ducke does not yet support:
- Searching, pushing, pulling, tagging and history of images
- System events, docker versioning, creating images from containers and authentication
- Exporting, resizing TTY, pausing, unpausing, inspecting changes for a container
- Interacting with the docker registry and hub
Inspired by dockerode.
Install
To use on the command line
npm install -g ducke
To use as an API
npm install ducke
Usage
Usage: ducke command [parameters]
ducke option
Common:
ps List all running containers
logs Attach to container logs
run Start a new container interactively
up Start a new container
exec Run a command inside an existing container
Containers:
inspect Show details about containers
kill Send SIGTERM to running containers
stop Stop containers
purge Remove week old stopped containers
rm Delete containers
Images:
ls List available images
orphans List all orphaned images
rmi Delete images
inspecti Show details about images
Building:
build Build an image from a Dockerfile
rebuild Build an image from a Dockerfile from scratch
Options:
-h Display this usage information
-v Display the version number
Examples
Command
$ ~ ducke ls 04c5d3b7b065 ubuntu:latest cf39b476aeec phusion/baseimage:0.9.15 ... 0e819813bc00 tutum/apache-php:latest ... 5327fda0d529 phusion/passenger-full:0.9.11
$ ~ ducke ps stopped happy_goldstine stopped loadbalancer-osx_daemon_1 stopped sleepy_turing
$ ~ ducke run ubuntu running cranky_kowalevski root@09d3215f6677:/# lsbin dev home lib64 mnt proc run srv tmp varboot etc lib media opt root sbin sys usrroot@09d3215f6677:/# /// $ ~ ducke exec cranky_kowalevski exec cranky_kowalevski root@10a2833bdafa:/# ps auxUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.4 0.3 18168 3164 ? Ss+ 04:19 0:00 bashroot 16 1.0 0.3 18172 3168 ? S 04:19 0:00 bashroot 31 0.0 0.2 15572 2100 ? R+ 04:19 0:00 ps auxroot@10a2833bdafa:/#
$ ~ ducke cull happy_goldstine sleepy_turing deleted happy_goldstine deleted sleepy_turing $ ~
API
var Ducke = ;var ducke = Ducke; // List all containersducke; // Start a containerducke start { console; }; // Create a containerducke ;
API Reference
ducke;ducke;ducke;ducke start {} ; ducke
Todo
- More of the docker API
- Tests