# docker-starter

> This module allows you to start and stop docker containers from node, using shelljs to pass docker commands to the command line

Latest version **1.0.1** (published 2018-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install docker-starter
pnpm add docker-starter
yarn add docker-starter
bun add docker-starter
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-11-25 |
| First published | 2018-11-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Oliver Diamond |
| Maintainers | unalterable |

## Links

- npm: https://www.npmjs.com/package/docker-starter
- Repository: https://github.com/unalterable/docker-starter
- Homepage: https://github.com/unalterable/docker-starter#readme
- Issues: https://github.com/unalterable/docker-starter/issues
- npm.io page: https://npm.io/package/docker-starter

## Dependencies (1)

- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3

## Recent versions

- 1.0.1 (latest) — 2018-11-25

## README

## Docker Starter

A simple npm module that allows you to start and stop docker containers from node, using shelljs to pass docker commands to the command line.

Designed to work on Linux distributions, and Mac (Darwin).

Because this package works by passing commands to the unix command line - you must already have the docker client installed and on $PATH. i.e. if you can run `docker ps` on the command line - then you should be good to go.


Installation:
```
npm install docker-starter
```

Example:

```
const dockerStarter = require('docker-starter');

const mongo = dockerStarter({
  container: 'db-test',
  image: 'mongo:4.0.4',
  extraOptions: '--restart on-failure:5',
  containerPort: 27017,
  publishedPort: 27019,
});

const { host, port, wasAlreadyRunning } = mongo.ensureRunning();

// do some stuff requiring mongo

mongo.stopAndRemove();
```

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