node-dock

0.4.0 • Public • Published

Dock

A sweet remedy for all your docker problems

Dock is an handy command that plugs on top of your usual docker commands adding some sugar and some handy function on top of it.

What does it mean?

This:

~  ᐅ docker ps
CONTAINER ID        IMAGE                           COMMAND                CREATED             STATUS              PORTS                    NAMES
b844c6472721        tutum/mysql:latest   "/bin/sh -c 'export    3 seconds ago       Up 3 seconds        0.0.0.0:4000->4000/tcp   sharp_elion         
~  ᐅ docker stop b844c6472721
b844c6472721

becomes this:

~  ᐅ dock stop tutum/mysql
running stop tutum/mysql d1ac1f9a916d on container d1ac1f9a916d
d1ac1f9a916d

sweeeeet

Installation

Install this library through NPM:

npm install -g node-dock

Usage

Dock comes with 2 handy commands on top of the usual ones:

List

Get the list of all your current containers:

~  ᐅ dock list
Image name: namshi/nginx-proxy:latest (id: 3563cd490f63)
Image name: tutum/mysql:latest (id: d1ac1f9a916d)
 

Clean

Cleanup all your inactive ones:

~  ᐅ dock clean
running rm d1ac1f9a916d on container d1ac1f9a916d
d1ac1f9a916d

Clean Images

And cleanup all your un-tagged images:

~  ᐅ dock clean images
running rmi d56522c3164e on container d56522c3164e
running rmi f1365340886d on container f1365340886d
running rmi f6a404a7172d on container f6a404a7172d
running rmi 205d4782d521 on container 205d4782d521
running rmi cea515493893 on container cea515493893
running rmi 7af0498ecd5b on container 7af0498ecd5b
running rmi 41e666c0e178 on container 41e666c0e178
running rmi f725abdabf27 on container f725abdabf27
running rmi 19fb2516cde9 on container 19fb2516cde9
running rmi 7523d53c4fea on container 7523d53c4fea
running rmi 533f6ceea42d on container 533f6ceea42d
running rmi 54b14e4b8f1a on container 54b14e4b8f1a

Run a docker command on a container, by image name

How many times you've dreamt of:

docker logs -f tutum/mysql

...now it's possible!

Whenever you create and run your new container you always know the image's name, but the id can be rather annoying to get every time.

Just add a --image || -i <name>, or your image name as last argument, in your usual docker command and dock will figure out what to do for you :)

dock <command> <commandArgs> --image <imageName>
 
# ie:
dock logs -f --image mikaelhg/docker-rabbitmq
 
# or
dock <command> <commandArgs> --i <imageName>
 
# or you can even omit the flag
dock logs -f mikaelhg/docker-rabbitmq

Readme

Keywords

Package Sidebar

Install

npm i node-dock

Weekly Downloads

0

Version

0.4.0

License

MIT

Last publish

Collaborators

  • unlucio
  • odino