UNPKG

1.68 kBMarkdownView Raw
1# DockerRemote
2
3Wrapper for the Docker remote API and CLI.
4
5## Usage
6
7 DockerRemote = require("docker-remote")
8
9 var container = {
10 name: "sidekick",
11 build: "bin/build",
12 run: "bin/sidekick",
13 env: { ENV: "production" },
14 git: "git@github.com:winton/sidekick.git#release",
15 repo: "quay.io/winton/sidekick"
16 };
17
18 var args = new DockerRemote.Args(container);
19 args.cliParams(); // parameters for CLI
20 args.apiParams(); // parameters for Docker Remote API
21
22 var container = new DockerRemote.Container(container);
23 container.run(); // run container through remote API
24 container.rm(); // remove container throught remote API
25
26 var image = new DockerRemote.Image(container);
27 image.build(); // build image through CLI
28 image.create(); // download image through remote API
29
30## Options
31
32The container object has the following possible keys:
33
34* `build` - The command to run within the Docker container after building the image, before pushing (optional).
35* `dockerfile` - The directory to discover the Dockerfile (optional).
36* `env` - Object containing environmental variables (optional).
37* `git` - A git repository URL string (optional).
38* `name` - The name of the container (required).
39* `ports` - An array of port strings in "[host-port]:[container-port]" format (optional).
40* `repo` - The Docker repository to push to on build (optional).
41* `run` - The command to run within the Docker container (optional).
42* `tags` - An array of tags to use when pushing the image (required).
43* `volumes` - An array of volume strings in "[host-dir]:[container-dir]:[rw|ro]" format (optional).
44
45## Dev setup
46
47 npm install
48
49## Docs
50
51 node_modules/.bin/codo lib
52 open doc/index.html