Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drdocker

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drdocker

Tophat and monocle for your DockerD. Docker.IO Node.JS library.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

DrDocker

Tophat and monocle for your DockerD. Docker.IO Node.JS library.

Installation

npm install drdocker

Usage

Note: DrDocker uses the docker CLI tool. This tool typically needs to be run as root. Hence these examples should be run with root privileges.

Check for an image


var drdocker = require('drdocker')

function gotImage(err) {
  if (err) throw err
  console.log("image exists!")
}

drdocker.haveImage("frozenridge/drdocker", gotImage)

Stream data into a container and commit result


var drdocker = require('drdocker')
var resumer = require('resumer')

var img = "ubuntu"

function dataStreamed(code, cid) {
  var newImg = "helloWorld"
  drdocker.commit({
    containerId: cid,
    imageName: newImg,
  }, function(err) {
    console.log("Created image %s from result", newImg)
    console.log("Now try running `docker run -i helloWorld cat /tmp/test.txt`")
  })
}

function gotImage(err) {
  if (err) throw err
  console.log("image exists - streaming")
  var dataStream = resumer().queue("Hello World!\n").end()
  var proc = drdocker.runInContainer(img, "cat > /tmp/test.txt", true, dataStreamed)

  dataStream.pipe(proc.stdin)
}

drdocker.haveImage(img, gotImage)

Tests

Requires root privileges and a local docker.

Run with npm test

License

BSD

Keywords

FAQs

Package last updated on 17 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc