[go: up one dir, main page]

Skip to content

LuKks/docker-bin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Run Dockerfile from a NPM package

Resources

License

Stars

Watchers

Forks

Packages

No packages published