xat / docker-build

docker build as a duplex stream

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-build

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

npm install docker-build

build status

Usage

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

var stream = build(tag, [options])

options can contain the following:

{
  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

About

docker build as a duplex stream

License:MIT License


Languages

Language:JavaScript 100.0%