Maintain existing ports

This lets the user change container settings without changing the Port
mappings
This commit is contained in:
Jeffrey Morgan 2015-02-27 13:02:20 -05:00
parent d411c2a673
commit a9a62c5d47
2 changed files with 9 additions and 4 deletions

View File

@ -119,10 +119,15 @@ var ContainerStore = assign(Object.create(EventEmitter.prototype), {
if (containerData.State && !containerData.State.Running) { if (containerData.State && !containerData.State.Running) {
self.fetchContainer(containerData.name, callback); self.fetchContainer(containerData.name, callback);
} else { } else {
container.start({ var startopts = {
PublishAllPorts: true,
Binds: binds Binds: binds
}, function (err) { };
if (containerData.NetworkSettings && containerData.NetworkSettings.Ports) {
startopts.PortBindings = containerData.NetworkSettings.Ports;
} else{
startopts.PublishAllPorts = true;
}
container.start(startopts, function (err) {
if (err) { if (err) {
callback(err); callback(err);
return; return;

View File

@ -59,7 +59,7 @@ var _steps = [{
message: 'To run Docker containers on your computer, Kitematic is starting a Linux virutal machine. This may take a minute...', message: 'To run Docker containers on your computer, Kitematic is starting a Linux virutal machine. This may take a minute...',
totalPercent: 60, totalPercent: 60,
percent: 0, percent: 0,
seconds: 46, seconds: 52,
run: Promise.coroutine(function* (progressCallback) { run: Promise.coroutine(function* (progressCallback) {
setupUtil.simulateProgress(this.seconds, progressCallback); setupUtil.simulateProgress(this.seconds, progressCallback);
yield virtualBox.vmdestroy('kitematic-vm'); yield virtualBox.vmdestroy('kitematic-vm');