aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-07 00:22:41 +0300
committerValentin Popov <info@valentineus.link>2017-10-07 00:22:41 +0300
commit0afd2000a5279c71ba3a1a72ad43ba1499507afb (patch)
tree27eafa1d9d0248843ebde87b2d3f38ae669aaf82
parent086b9032d589d7065aa049a67e6922148ea3f4fc (diff)
downloadsimple-container-0afd2000a5279c71ba3a1a72ad43ba1499507afb.tar.xz
simple-container-0afd2000a5279c71ba3a1a72ad43ba1499507afb.zip
Add an API description
-rw-r--r--README.md27
1 files changed, 25 insertions, 2 deletions
diff --git a/README.md b/README.md
index 1745d2c..5fc2c20 100644
--- a/README.md
+++ b/README.md
@@ -19,10 +19,9 @@ npm install --save simple-container
A simple example that creates and starts a container:
```JavaScript
import Containers from 'simple-container';
-
var containers = new Containers();
-containers.create('postgres:alpine').then(container => {
+containers.create('hello-world:latest').then(container => {
console.info(`The ${container.id} container was created.`);
start(container);
});
@@ -74,6 +73,8 @@ containers.create({
Examples and details in
[the documentation](https://github.com/apocas/dockerode#manipulating-a-container).
+#### Third-party repository
+
An additional example of obtaining a private image:
```JavaScript
var auth = {
@@ -92,6 +93,28 @@ containers.create({
Details in
[the documentation](https://github.com/apocas/dockerode#pull-from-private-repos).
+## API
+### create(options) ⇒ <code>Promise</code>
+Creates a container by options or name, returning the management interface.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| options | <code>String</code> \ <code>Object</code> | The name of the image or options |
+
+### get([id]) ⇒ <code>Promise</code>
+Returns the container management interface.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [id] | <code>String</code> | Container ID |
+
+### info([id]) ⇒ <code>Promise</code>
+Searches in existing containers.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [id] | <code>String</code> | Container ID |
+
## Debugging
Use the `DEBUG` variable with the `containers` option.