# nodoecker

> A wrapper around docker-remote-api

Latest version **0.2.0** (published 2015-05-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install nodoecker
pnpm add nodoecker
yarn add nodoecker
bun add nodoecker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-05-29 |
| First published | 2015-04-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Todd Kennedy |
| Maintainers | toddself, scriptollc |
| Keywords | docker, node, docker, remote, boot2docker |

## Links

- npm: https://www.npmjs.com/package/nodoecker
- Repository: https://github.com/scriptollc/nodoecker
- Issues: https://github.com/scriptollc/nodoecker/issues
- npm.io page: https://npm.io/package/nodoecker

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ~2.2.0
- [xtend](https://npm.io/package/xtend.md) ~4.0.0
- [bluebird](https://npm.io/package/bluebird.md) ~2.9.25
- [byte-size](https://npm.io/package/byte-size.md) ~0.1.0
- [native-or-bluebird](https://npm.io/package/native-or-bluebird.md) ~1.2.0
- [docker-remote-api-as-promised](https://npm.io/package/docker-remote-api-as-promised.md) ~1.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2015-05-29
- 0.1.3 — 2015-05-28
- 0.1.2 — 2015-05-28
- 0.1.1 — 2015-05-28
- 0.1.0 — 2015-05-27
- 0.0.1 — 2015-04-21

## README

# Nodöcker (nodoecker)
A node/docker API designed to mimic the UI from the Docker CLI as much as possible. The Docker REST API doesn't map very clearly, and if you have experience with using the CLI, you're going to be spend a lot of time reading the API docs to figure out how to do the same things. This attempts to fix that.

And yes it uses promises. This was designed to work with [Koa](https://github.com/koajs/koa) so it's promises. But it will use the built-in `Promise` object
if it exists. And [bluebird](https://npmjs.org/package/bluebird) if not.

Don't like promises? Perhaps you should read ["We have a problem with promises"](http://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html).

## Install

```sh
npm i -S nodoecker
```

## Usage

```js
var Nodeocker = require('nodeocker');
// If you are working with private images, you can login to the docker registry
// by passing the following object into the constructor
var authObj = {
  username: 'test',
  password: 'test',
  email: 'test@example.com'
};
var nd = new Nodeocker('/var/run/docker.sock', authObj);
nd
  .pull('busybox:latest')
  .then(function(busybox) {
    return busybox.Inspect();
  })
  .then(function(busybox) {
    console.log(busybox.size);
    return nd.run('myBusybox', 'busybox');
  })
  .then(function(myBusybox) {
    return myBusybox.Inspect();
  })
  .then(function(myBusybox) {
    console.log(myBusybox.Cmd[0]);
    console.log(myBuxbox.ExposedPorts);
  })
  .catch(function(err) {
    console.log('O NOES', err);
  });
```

## Implemented API
It only implements a portion subset of the Docker API current:

* Pulling images [`docker pull`]
* Creating containers [`docker run`]
* Stopping containers [`docker stop`]
* Restarting containers [`docker restart`]
* Inspecting containers and images [`docker inspect`]
* Getting image history [`docker history`]
* Listing all images available [`docker images`]
* Listing all running containers [`docker ps`]

Pull-Requests to implement more of the API or to provide better alignment against the CLI versus the exposed parts of the API are very welcome!

## Tests

```
npm test
```

It will attempt to talk to Docker via `/var/run/docker.sock`. If your Docker
daemon is running in a different place you can specify it by setting the `DOCKER_SOCK` environment variable.

```
DOCKER_SOCK=http://127.0.0.1:9000 npm test
```

## Licenese
Apache 2.0; Copyright &copy; 2015 Scripto

---
_Source: https://npm.io/package/nodoecker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
