docker-bin

1.3.0 • Public • Published

docker-bin

Run Dockerfile from a NPM package

npm i docker-bin

Usage

#!/usr/bin/env node

require('docker-bin')(__dirname, { cwd: true })

The user can disable any forced option in the code like so --cwd=false.

API

bin(dirname, [options])

Build and run the Dockerfile that is in dirname.

The name and version from package.json is used to tag the Docker image.

It uses process.argv to override the default options.

Available options

{
  sudo = false, // Run Docker commands with sudo
  persistent = false, // Keep container after being stopped
  cwd = false, // Map the working directory into /mnt/cwd
  home = false, // Map the home directory into /mnt/home
  volume = null, // Map custom directories
  privileged = false, // Access to all devices, disables AppArmor/SELinux, etc
  device = null // Map a specific device like /dev/ttyUSB0
}

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i docker-bin

Weekly Downloads

15

Version

1.3.0

License

MIT

Unpacked Size

5.15 kB

Total Files

4

Last publish

Collaborators

  • lukks