diff --git a/meteor/client/stylesheets/dashboard.import.less b/meteor/client/stylesheets/dashboard.import.less index 708e78e759..916d4abe3b 100755 --- a/meteor/client/stylesheets/dashboard.import.less +++ b/meteor/client/stylesheets/dashboard.import.less @@ -148,6 +148,7 @@ } min-height: @dashboard-content-height; max-height: @dashboard-content-height; + overflow-x: hidden; overflow-y: overlay; } .nav-tabs > li, diff --git a/meteor/server/apps.js b/meteor/server/apps.js index 1cd94115d8..3f253afbd6 100755 --- a/meteor/server/apps.js +++ b/meteor/server/apps.js @@ -1,7 +1,7 @@ var watchers = {}; removeBindFolder = function (name, callback) { - exec(path.join(getBinDir(), 'boot2docker') + ' ssh "rm -rf /var/lib/docker/binds/' + name + '"', function(err, stdout) { + exec(path.join(getBinDir(), 'boot2docker') + ' ssh "sudo rm -rf /var/lib/docker/binds/' + name + '"', function(err, stdout) { callback(err, stdout); }); }; @@ -104,7 +104,7 @@ recoverApps = function (callback) { } var container = docker.getContainer(app.docker.Id); container.inspect(function (err, data) { - if (app.status !== 'STARTING' && !data.State.Running) { + if (app.status !== 'STARTING' && data && data.State && !data.State.Running) { console.log('restarting: ' + app.name); console.log(app.docker.Id); Fiber(function () { @@ -181,8 +181,15 @@ Meteor.methods({ var image = Images.findOne(appObj.imageId); loadKiteVolumes(image.path, appObj.name); var app = Apps.findOne(appId); - Meteor.call('runApp', app, function (err) { - if (err) { throw err; } + removeBindFolder(app.name, function (err) { + if (err) { + console.error(err); + } + Fiber(function () { + Meteor.call('runApp', app, function (err) { + if (err) { throw err; } + }); + }).run(); }); } }, diff --git a/meteor/server/docker.js b/meteor/server/docker.js index 2f038c48a9..2127ed8be4 100755 --- a/meteor/server/docker.js +++ b/meteor/server/docker.js @@ -128,7 +128,7 @@ var getFromImage = function (dockerfile) { var regex = new RegExp(patternString, "g"); var fromInstruction = dockerfile.match(regex); if (fromInstruction && fromInstruction.length > 0) { - return fromInstruction[0].split(' ')[1].trim(); + return fromInstruction[0].replace('FROM', '').trim(); } else { return null; } @@ -199,12 +199,14 @@ createTarFileSync = function (image) { var convertVolumeObjToArray = function (obj) { var result = []; - _.each(_.keys(obj), function (key) { - var volumeObj = {}; - volumeObj.Path = key; - volumeObj.Value = obj[key]; - result.push(volumeObj); - }); + if (obj !== null && typeof obj === 'object') { + _.each(_.keys(obj), function (key) { + var volumeObj = {}; + volumeObj.Path = key; + volumeObj.Value = obj[key]; + result.push(volumeObj); + }); + } return result; };