Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/apocas/dockerode
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Nov 12, 2018
2 parents f62c9eb + 9d802e5 commit 8f3aa85
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions examples/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,32 @@ docker.run('ubuntu', [], process.stdout, {
'Binds': ['/home/vagrant:/stuff'],
}
}, function(err, data, container) {
if (err){
return console.error(err);
}
console.log(data.StatusCode);
});



//run and give a container a name and a label
docker.run('redis', [], undefined, {
"name": 'MyNamedContainer',
"Labels": {
"environment": "blueWhale"
},
"HostConfig": {
"PortBindings": {
"6379/tcp": [
{
"HostPort": "0" //Map container to a random unused port.
}
]
}
}
}, function(err, data, container) {
if (err){
return console.error(err);
}
console.log(data.StatusCode);
});

0 comments on commit 8f3aa85

Please sign in to comment.