Merge branch 'master' into windows

This commit is contained in:
Jeffrey Morgan 2015-06-09 23:18:12 -07:00
commit a232108dd3
9 changed files with 30 additions and 17 deletions

View File

@ -18,13 +18,14 @@ Before you fil an issue or a pull request, quickly read of the following tips on
### Prerequisites ### Prerequisites
Most of the time, you'll have installed Kitematic before contibuting, but for the Most of the time, you'll have installed Kitematic before contibuting, but for the
sake of completeness, you can also install [Node.js](https://nodejs.org/) and the latest Xcode from the Apple App Store and then run from your Git clone. sake of completeness, you can also install [Node.js 0.10.38](https://nodejs.org/dist/v0.10.38/).
Running `npm start` will download and install the OS X Docker client, ### Other Prerequisites (Mac)
[Docker machine](https://github.com/docker/machine), - The latest Xcode from the Apple App Store.
the [Boot2Docker iso](https://github.com/boot2docker/boot2docker),
[Electron](http://electron.atom.io/), and [VirtualBox](https://www.virtualbox.org/) ### Other Prerequisites (Windows)
if needed. - [Visual Studio 2013 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx) (or similar)
- [Python](https://www.python.org/downloads/release/python-2710/)
### Getting Started ### Getting Started
@ -34,6 +35,11 @@ To run the app in development:
- `npm start` - `npm start`
Running `npm start` will download and install the OS X Docker client,
[Docker Machine](https://github.com/docker/machine), [Docker Compose](https://github.com/docker/compose)
the [Boot2Docker iso](https://github.com/boot2docker/boot2docker),
[Electron](http://electron.atom.io/).
### Building & Release ### Building & Release
- `npm run release` - `npm run release`

View File

@ -28,10 +28,9 @@ container!
## Technical Details ## Technical Details
Kitematic is a self-contained .app, with a two exceptions: Kitematic is a self-contained .app, with an exception:
- It will install VirtualBox if it's not already installed. - It will install VirtualBox if it's not already installed.
- It copies the `docker` and `docker-machine` binaries to `/usr/local/bin` for
convenience. convenience.
### Why does Kitematic need my root password? ### Why does Kitematic need my root password?

View File

@ -207,7 +207,7 @@ gulp.task('download-docker', function (cb) {
} else { } else {
request('https://get.docker.com/builds/Darwin/x86_64/docker-' + packagejson['docker-version']) request('https://get.docker.com/builds/Darwin/x86_64/docker-' + packagejson['docker-version'])
.pipe(fs.createWriteStream('./resources/docker')).on('finish', function () { .pipe(fs.createWriteStream('./resources/docker')).on('finish', function () {
fs.chmodSync('./resources/docker', 755); fs.chmodSync('./resources/docker', 0755);
cb(); cb();
}); });
} }
@ -230,7 +230,7 @@ gulp.task('download-docker-machine', function (cb) {
} else { } else {
request('https://github.com/docker/machine/releases/download/v' + packagejson['docker-machine-version'] + '/docker-machine_darwin-amd64') request('https://github.com/docker/machine/releases/download/v' + packagejson['docker-machine-version'] + '/docker-machine_darwin-amd64')
.pipe(fs.createWriteStream('./resources/docker-machine')).on('finish', function () { .pipe(fs.createWriteStream('./resources/docker-machine')).on('finish', function () {
fs.chmodSync('./resources/docker-machine', 755); fs.chmodSync('./resources/docker-machine', 0755);
cb(); cb();
}); });
} }
@ -252,7 +252,7 @@ gulp.task('download-docker-compose', function (cb) {
gutil.log(gutil.colors.green('Downloading Docker Compose')); gutil.log(gutil.colors.green('Downloading Docker Compose'));
request('https://github.com/docker/compose/releases/download/' + packagejson['docker-compose-version'] + '/docker-compose-Darwin-x86_64') request('https://github.com/docker/compose/releases/download/' + packagejson['docker-compose-version'] + '/docker-compose-Darwin-x86_64')
.pipe(fs.createWriteStream('./resources/docker-compose')).on('finish', function () { .pipe(fs.createWriteStream('./resources/docker-compose')).on('finish', function () {
fs.chmodSync('./resources/docker-compose', 755); fs.chmodSync('./resources/docker-compose', 0755);
cb(); cb();
}); });
} }

View File

@ -26,7 +26,7 @@
} }
], ],
"docker-version": "1.6.2", "docker-version": "1.6.2",
"docker-machine-version": "0.3.0-rc1", "docker-machine-version": "0.3.0-rc2",
"docker-compose-version": "1.2.0", "docker-compose-version": "1.2.0",
"electron-version": "0.27.2", "electron-version": "0.27.2",
"virtualbox-version": "4.3.28", "virtualbox-version": "4.3.28",

View File

@ -102,8 +102,12 @@ var ContainerDetailsSubheader = React.createClass({
if (!this.disableTerminal()) { if (!this.disableTerminal()) {
metrics.track('Terminaled Into Container'); metrics.track('Terminaled Into Container');
var container = this.props.container; var container = this.props.container;
var shell = ContainerUtil.env(container).SHELL; var shell = ContainerUtil.env(container).reduce((envs, env) => {
if(typeof shell === 'undefined') { envs[env[0]] = env[1];
return envs;
}, {}).SHELL;
if(!shell) {
shell = 'sh'; shell = 'sh';
} }
machine.ip().then(ip => { machine.ip().then(ip => {

View File

@ -25,7 +25,7 @@ var ContainerHomeFolder = React.createClass({
}, (index) => { }, (index) => {
if (index === 0) { if (index === 0) {
var volumes = _.clone(this.props.container.Volumes); var volumes = _.clone(this.props.container.Volumes);
var newHostVolume = path.join(util.home(), 'Kitematic', this.props.container.Name, containerVolume); var newHostVolume = path.join(util.home(), util.documents(), 'Kitematic', this.props.container.Name, containerVolume);
volumes[containerVolume] = newHostVolume; volumes[containerVolume] = newHostVolume;
var binds = _.pairs(volumes).map(function (pair) { var binds = _.pairs(volumes).map(function (pair) {
if(util.isWindows()) { if(util.isWindows()) {

View File

@ -103,6 +103,8 @@ export default {
containerData.Env = containerData.Config.Env; containerData.Env = containerData.Config.Env;
} }
containerData.Volumes = _.mapObject(containerData.Volumes, () => {return {};});
let existing = this.client.getContainer(name); let existing = this.client.getContainer(name);
existing.kill(() => { existing.kill(() => {
existing.remove(() => { existing.remove(() => {
@ -203,7 +205,6 @@ export default {
containerServerActions.error({name, error}); containerServerActions.error({name, error});
return; return;
} }
existingData.name = existingData.Name || name;
if (existingData.Config && existingData.Config.Image) { if (existingData.Config && existingData.Config.Image) {
existingData.Image = existingData.Config.Image; existingData.Image = existingData.Config.Image;

View File

@ -56,7 +56,7 @@ module.exports = {
recommended: function () { recommended: function () {
request.get('https://kitematic.com/recommended.json', (error, response, body) => { request.get('https://kitematic.com/recommended.json', (error, response, body) => {
if (error) { if (error) {
repositoryServerActions.recommendedError({error}); repositoryServerActions.error({error});
} }
let data = JSON.parse(body); let data = JSON.parse(body);

View File

@ -41,6 +41,9 @@ module.exports = {
home: function () { home: function () {
return app.getPath('home'); return app.getPath('home');
}, },
documents: function () {
return this.isWindows() ? 'My\ Documents' : 'Documents';
},
supportDir: function () { supportDir: function () {
return app.getPath('userData'); return app.getPath('userData');
}, },