mirror of https://github.com/docker/docs.git
Moved additional eth2 network to instead replace eth1, bumped Boot2Docker dependency to 1.3
This commit is contained in:
parent
d949b86198
commit
c5b54f7dbb
|
@ -61,12 +61,10 @@ Boot2Docker.ip = function (callback) {
|
||||||
|
|
||||||
Boot2Docker.setIp = function (ifname, ip, 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 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 rm -rf /var/lib/boot2docker/tls/* && sudo /etc/init.d/docker restart"', function (err, stdout) {
|
||||||
Boot2Docker.exec('ssh "sudo /usr/local/etc/init.d/docker restart"', function (err, stdout) {
|
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Boot2Docker.init = function (callback) {
|
Boot2Docker.init = function (callback) {
|
||||||
|
@ -83,11 +81,9 @@ Boot2Docker.start = function (callback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.exec('start', function (err, stdout) {
|
self.exec('start', function (err, stdout) {
|
||||||
// Sometimes boot2docker returns an error code even though it's working / waiting, so treat that as
|
// Sometimes boot2docker returns an error code even though it's working / waiting, so treat that as success as well
|
||||||
// Success as well
|
if (!err || (err.indexOf('Waiting') !== -1 || err.indexOf('Writing') !== -1 || err.indexOf('Generating a server cert') !== -1)) {
|
||||||
if (!err || (err.indexOf('Waiting') !== -1 || err.indexOf('Writing') !== -1)) {
|
|
||||||
self.correct(function (err) {
|
self.correct(function (err) {
|
||||||
if (err) { callback(err); return; }
|
|
||||||
self.injectUtilities(function (err) {
|
self.injectUtilities(function (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,6 +14,7 @@ Docker.HOST_PORT = '2376';
|
||||||
|
|
||||||
Docker.client = function () {
|
Docker.client = function () {
|
||||||
return new Dockerode({
|
return new Dockerode({
|
||||||
|
protocol: 'https',
|
||||||
host: Docker.HOST_IP,
|
host: Docker.HOST_IP,
|
||||||
port: Docker.HOST_PORT,
|
port: Docker.HOST_PORT,
|
||||||
ca: fs.readFileSync(path.join(Docker.CERT_DIR, 'ca.pem')),
|
ca: fs.readFileSync(path.join(Docker.CERT_DIR, 'ca.pem')),
|
||||||
|
@ -353,6 +354,7 @@ Docker.reloadDefaultContainers = function (callback) {
|
||||||
async.until(function () {
|
async.until(function () {
|
||||||
return ready;
|
return ready;
|
||||||
}, function (callback) {
|
}, function (callback) {
|
||||||
|
docker = Docker.client();
|
||||||
docker.listContainers(function (err) {
|
docker.listContainers(function (err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
ready = true;
|
ready = true;
|
||||||
|
|
|
@ -119,7 +119,13 @@ Installer.steps = [
|
||||||
if (state !== 'running') {
|
if (state !== 'running') {
|
||||||
console.log('starting');
|
console.log('starting');
|
||||||
Boot2Docker.start(function (err) {
|
Boot2Docker.start(function (err) {
|
||||||
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Boot2Docker.setIp('eth1', Boot2Docker.REQUIRED_IP, function(err) {
|
||||||
|
callback(err);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Boot2Docker.setIp('eth1', Boot2Docker.REQUIRED_IP, function(err) {
|
Boot2Docker.setIp('eth1', Boot2Docker.REQUIRED_IP, function(err) {
|
||||||
|
|
|
@ -157,24 +157,8 @@ Meteor.setInterval(function () {
|
||||||
Meteor.setInterval(function () {
|
Meteor.setInterval(function () {
|
||||||
if (!Session.get('installing')) {
|
if (!Session.get('installing')) {
|
||||||
Sync.resolveWatchers(function () {});
|
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();
|
ImageUtil.sync();
|
||||||
AppUtil.sync();
|
AppUtil.sync();
|
||||||
|
AppUtil.recover();
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
Loading…
Reference in New Issue