Moved additional eth2 network to instead replace eth1, bumped Boot2Docker dependency to 1.3

This commit is contained in:
Jeff Morgan 2014-10-19 19:37:37 -07:00
parent d949b86198
commit c5b54f7dbb
4 changed files with 14 additions and 26 deletions

View File

@ -61,10 +61,8 @@ Boot2Docker.ip = function (callback) {
Boot2Docker.setIp = function (ifname, ip, callback) {
Boot2Docker.exec('ssh "sudo ifconfig ' + ifname + ' ' + ip + ' netmask 255.255.255.0"', function (err, stdout) {
Boot2Docker.exec('ssh "sudo awk \'{print $0 \",192.168.60.103\"}\' /var/lib/boot2docker/tls/hostnames > temp && sudo mv temp /var/lib/boot2docker/tls/hostnames && sudo chown root.root /var/lib/boot2docker/tls', function (err, stdout) {
Boot2Docker.exec('ssh "sudo /usr/local/etc/init.d/docker restart"', function (err, stdout) {
callback(err);
});
Boot2Docker.exec('ssh "sudo rm -rf /var/lib/boot2docker/tls/* && sudo /etc/init.d/docker restart"', function (err, stdout) {
callback(err);
});
});
};
@ -83,11 +81,9 @@ Boot2Docker.start = function (callback) {
return;
}
self.exec('start', function (err, stdout) {
// Sometimes boot2docker returns an error code even though it's working / waiting, so treat that as
// Success as well
if (!err || (err.indexOf('Waiting') !== -1 || err.indexOf('Writing') !== -1)) {
// Sometimes boot2docker returns an error code even though it's working / waiting, so treat that as success as well
if (!err || (err.indexOf('Waiting') !== -1 || err.indexOf('Writing') !== -1 || err.indexOf('Generating a server cert') !== -1)) {
self.correct(function (err) {
if (err) { callback(err); return; }
self.injectUtilities(function (err) {
callback(err);
});

View File

@ -14,6 +14,7 @@ Docker.HOST_PORT = '2376';
Docker.client = function () {
return new Dockerode({
protocol: 'https',
host: Docker.HOST_IP,
port: Docker.HOST_PORT,
ca: fs.readFileSync(path.join(Docker.CERT_DIR, 'ca.pem')),
@ -353,6 +354,7 @@ Docker.reloadDefaultContainers = function (callback) {
async.until(function () {
return ready;
}, function (callback) {
docker = Docker.client();
docker.listContainers(function (err) {
if (!err) {
ready = true;

View File

@ -119,7 +119,13 @@ Installer.steps = [
if (state !== 'running') {
console.log('starting');
Boot2Docker.start(function (err) {
callback(err);
if (err) {
callback(err);
return;
}
Boot2Docker.setIp('eth1', Boot2Docker.REQUIRED_IP, function(err) {
callback(err);
});
});
} else {
Boot2Docker.setIp('eth1', Boot2Docker.REQUIRED_IP, function(err) {

View File

@ -157,24 +157,8 @@ Meteor.setInterval(function () {
Meteor.setInterval(function () {
if (!Session.get('installing')) {
Sync.resolveWatchers(function () {});
if (!Session.get('boot2dockerOff')) {
fixBoot2DockerVM(function (err) {
if (err) { console.log(err); return; }
AppUtil.recover();
fixDefaultImages(function (err) {
if (err) { console.log(err); return; }
fixDefaultContainers(function (err) {
if (err) { console.log(err); }
});
});
});
}
}
}, 5000);
Meteor.setInterval(function () {
if (!Session.get('installing')) {
ImageUtil.sync();
AppUtil.sync();
AppUtil.recover();
}
}, 5000);