-
-
Notifications
You must be signed in to change notification settings - Fork 486
Closed
Description
Hello!
The README contains the following example code:
docker.run('ubuntu', ['bash', '-c', 'uname -a'], [process.stdout, process.stderr], {Tty:false}, function (err, data, container) {
//...
}).on('container', function (container) {
container.defaultOptions.start.Binds = ["/tmp:/tmp:rw"];
});However, setting container.defaultOptions.start.Binds, at least during the container event callback, doesn't actually seem to do anything, at least when running Docker for Windows (the native version, not Docker Toolbox). What does seem to work is passing Hostconfig.Binds in the options to docker.run, which your example at examples/run.js does:
docker.run('ubuntu', [], process.stdout, {
'Volumes': {
'/stuff': {}
},
'ExposedPorts': {
'80/tcp': {}
},
'Hostconfig': {
'Binds': ['/home/vagrant:/stuff'],
}
}, function(err, data, container) {
console.log(data.StatusCode);
});It took me a few hours to figure this out, especially since the defaultOptions.start.Binds method did seem to work earlier this year on an OS X system. I'm not sure if it's the Docker API that's changed or if it has something to do with me being on Windows native, but I figured I'd mention it here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels