Created
May 12, 2014 10:00
-
-
Save daviddias/d3717e292a5cbd5beb7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Docker = require('dockerode'); | |
var docker = new Docker({socketPath: '/var/run/docker.sock'}); | |
docker.createContainer({ Image: 'ubuntu', Cmd: ['/bin/ls','/stuff'], "Volumes":{"/stuff": {}} }, function (err, container) { | |
container.attach({stream: true, stdout: true, stderr: true, tty: true}, function (err, stream) { | |
stream.pipe(process.stdout); | |
container.start({"Binds":["/home/vagrant:/stuff"]}, function (err, data) { | |
console.log(data); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment