mirror of https://github.com/docker/docs.git
Windows installer
This commit is contained in:
parent
94113feaed
commit
47967507dc
|
|
@ -41,7 +41,11 @@ var _steps = [{
|
||||||
yield virtualBox.killall();
|
yield virtualBox.killall();
|
||||||
progressCallback(50); // TODO: detect when the installation has started so we can simulate progress
|
progressCallback(50); // TODO: detect when the installation has started so we can simulate progress
|
||||||
try {
|
try {
|
||||||
yield util.exec(setupUtil.macSudoCmd(setupUtil.installVirtualBoxCmd()));
|
if (util.isWindows()) {
|
||||||
|
yield util.exec([path.join(util.supportDir(), virtualBox.filename())]);
|
||||||
|
} else {
|
||||||
|
yield util.exec(setupUtil.macSudoCmd(setupUtil.installVirtualBoxCmd()));
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw null;
|
throw null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,11 @@ var DockerMachine = {
|
||||||
},
|
},
|
||||||
create: function () {
|
create: function () {
|
||||||
var dockerversion = util.packagejson()['docker-version'];
|
var dockerversion = util.packagejson()['docker-version'];
|
||||||
return util.exec([this.command(), '-D', 'create', '-d', 'virtualbox', '--virtualbox-boot2docker-url', path.join(process.cwd(), 'resources', 'boot2docker-' + dockerversion + '.iso'), '--virtualbox-memory', '2048', NAME]);
|
if (util.isWindows()) {
|
||||||
|
return util.exec([this.command(), '-D', 'create', '-d', 'virtualbox', '--virtualbox-memory', '2048', NAME]);
|
||||||
|
} else {
|
||||||
|
return util.exec([this.command(), '-D', 'create', '-d', 'virtualbox', '--virtualbox-boot2docker-url', path.join(process.cwd(), 'resources', 'boot2docker-' + dockerversion + '.iso'), '--virtualbox-memory', '2048', NAME]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
start: function () {
|
start: function () {
|
||||||
return util.exec([this.command(), '-D', 'start', NAME]);
|
return util.exec([this.command(), '-D', 'start', NAME]);
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,8 @@ export default {
|
||||||
localStorage.setItem('placeholders', JSON.stringify(this.placeholders));
|
localStorage.setItem('placeholders', JSON.stringify(this.placeholders));
|
||||||
|
|
||||||
this.pullImage(repository, tag, error => {
|
this.pullImage(repository, tag, error => {
|
||||||
|
delete this.placeholders[name];
|
||||||
|
localStorage.setItem('placeholders', JSON.stringify(this.placeholders));
|
||||||
if (error) {
|
if (error) {
|
||||||
containerServerActions.error({name, error});
|
containerServerActions.error({name, error});
|
||||||
return;
|
return;
|
||||||
|
|
@ -179,8 +181,6 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete this.placeholders[name];
|
|
||||||
localStorage.setItem('placeholders', JSON.stringify(this.placeholders));
|
|
||||||
this.createContainer(name, {Image: imageName});
|
this.createContainer(name, {Image: imageName});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -374,6 +374,7 @@ export default {
|
||||||
var data = JSON.parse(str);
|
var data = JSON.parse(str);
|
||||||
|
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
|
console.log(data.error);
|
||||||
callback(data.error);
|
callback(data.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ var Promise = require('bluebird');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var crypto = require('crypto');
|
var crypto = require('crypto');
|
||||||
|
var remote = require('remote');
|
||||||
|
var app = remote.require('app');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
exec: function (args, options) {
|
exec: function (args, options) {
|
||||||
|
|
@ -37,18 +39,10 @@ module.exports = {
|
||||||
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
||||||
},
|
},
|
||||||
home: function () {
|
home: function () {
|
||||||
return process.env[this.isWindows() ? 'USERPROFILE' : 'HOME'];
|
return app.getPath('home');
|
||||||
},
|
},
|
||||||
supportDir: function () {
|
supportDir: function () {
|
||||||
var dirs = ['Library', 'Application\ Support', 'Kitematic'];
|
return app.getPath('userData');
|
||||||
var acc = this.home();
|
|
||||||
dirs.forEach(function (d) {
|
|
||||||
acc = path.join(acc, d);
|
|
||||||
if (!fs.existsSync(acc)) {
|
|
||||||
fs.mkdirSync(acc);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return acc;
|
|
||||||
},
|
},
|
||||||
CommandOrCtrl: function () {
|
CommandOrCtrl: function () {
|
||||||
return this.isWindows() ? 'Ctrl' : 'Command';
|
return this.isWindows() ? 'Ctrl' : 'Command';
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,7 @@ var VirtualBox = {
|
||||||
return util.isWindows() ? util.packagejson()['virtualbox-checksum-win'] : util.packagejson()['virtualbox-checksum'];
|
return util.isWindows() ? util.packagejson()['virtualbox-checksum-win'] : util.packagejson()['virtualbox-checksum'];
|
||||||
},
|
},
|
||||||
url: function () {
|
url: function () {
|
||||||
if(util.isWindows()) {
|
return `https://github.com/kitematic/virtualbox/releases/download/${util.packagejson()['virtualbox-version']}/${this.filename()}`;
|
||||||
return 'http://download.virtualbox.org/virtualbox/4.3.26/VirtualBox-4.3.26-98988-Win.exe';
|
|
||||||
} else {
|
|
||||||
return `https://github.com/kitematic/virtualbox/releases/download/${util.packagejson()['virtualbox-version']}/${this.filename()}`;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
installed: function () {
|
installed: function () {
|
||||||
if(util.isWindows()) {
|
if(util.isWindows()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue