# docker-build

> docker build as a duplex stream

Latest version **2.2.0** (published 2014-11-04) · MIT license · 0 weekly downloads

## Install

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

Provides the command `docker-build`.

## 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 | 2.2.0 |
| Published | 2014-11-04 |
| First published | 2014-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Mathias Buus |
| Maintainers | mafintosh |
| Keywords | docker, build, tar, duplex, stream |

## Links

- npm: https://www.npmjs.com/package/docker-build
- Repository: https://github.com/mafintosh/docker-build
- Issues: https://github.com/mafintosh/docker-build/issues
- npm.io page: https://npm.io/package/docker-build

## Dependencies (8)

- [tar-fs](https://npm.io/package/tar-fs.md) ^1.0.0
- [minimist](https://npm.io/package/minimist.md) ^1.1.0
- [duplexify](https://npm.io/package/duplexify.md) ^3.2.0
- [tar-stream](https://npm.io/package/tar-stream.md) ^1.0.0
- [ignore-file](https://npm.io/package/ignore-file.md) ^1.1.2
- [through-json](https://npm.io/package/through-json.md) ^1.1.0
- [concat-stream](https://npm.io/package/concat-stream.md) ^1.4.6
- [docker-remote-api](https://npm.io/package/docker-remote-api.md) ^4.4.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2014-11-04
- 2.1.4 — 2014-10-25
- 2.1.3 — 2014-10-19
- 2.1.2 — 2014-10-08
- 2.1.1 — 2014-10-06
- 2.1.0 — 2014-09-16
- 2.0.2 — 2014-09-14
- 2.0.1 — 2014-09-13
- 2.0.0 — 2014-09-10
- 1.6.1 — 2014-07-09
- 1.6.0 — 2014-07-08
- 1.5.0 — 2014-07-08
- 1.4.1 — 2014-07-06
- 1.4.0 — 2014-07-06
- 1.3.1 — 2014-06-14
- … 10 more at https://npm.io/package/docker-build/versions

## README

# docker-build

Docker build as a duplex stream. Pipe in a tar stream and pipe out the build output

``` js
npm install docker-build
```

[![build status](http://img.shields.io/travis/mafintosh/docker-build.svg?style=flat)](http://travis-ci.org/mafintosh/docker-build)

## Usage

``` js
var build = require('docker-build')
var fs = require('fs')

fs.createReadStream('a-tar-file-with-a-dockerfile.tar')
  .pipe(build('my-new-image'))
  .pipe(process.stdout)
```

The above example will build a docker image from the input tarball
and pipe the build output to stdout using docker running locally on port 2375.

## API

``` js
var stream = build(tag, [options])
```

`options` can contain the following:

``` js
{
  host: '/var/run/docker.sock', // host to docker
  cache: true, // whether or not to use docker fs cache (defaults to true)
  quiet: false, // be quiet - defaults to false,
  registry: conf, // add a registry config
  remove: true, // automatically removes intermediate contaners (defaults to true)
  forceremove: false // always remove intermediate containers, even if the build fails (defaults to false)
}
```

## CLI

There is a command line too available as well

```
$ npm install -g docker-build
$ docker-build --help
```

Running `docker-build some-image-tag` will build current working directory

## License

MIT

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