mirror of https://github.com/docker/docs.git
Added CirclCI hooks and cleaned up packager names
Signed-off-by: French Ben <frenchben@docker.com>
This commit is contained in:
commit
2bdaddd2b1
|
|
@ -29,6 +29,7 @@ module.exports = function (grunt) {
|
||||||
var OSX_FILENAME = OSX_OUT_X64 + '/' + OSX_APPNAME + '.app';
|
var OSX_FILENAME = OSX_OUT_X64 + '/' + OSX_APPNAME + '.app';
|
||||||
var LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_amd64.deb';
|
var LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_amd64.deb';
|
||||||
|
|
||||||
|
|
||||||
var IS_WINDOWS = process.platform === 'win32';
|
var IS_WINDOWS = process.platform === 'win32';
|
||||||
var IS_LINUX = process.platform === 'linux';
|
var IS_LINUX = process.platform === 'linux';
|
||||||
|
|
||||||
|
|
@ -144,7 +145,9 @@ module.exports = function (grunt) {
|
||||||
dest: 'build/'
|
dest: 'build/'
|
||||||
}, {
|
}, {
|
||||||
cwd: 'node_modules/',
|
cwd: 'node_modules/',
|
||||||
src: Object.keys(packagejson.dependencies).map(function (dep) { return dep + '/**/*';}),
|
src: Object.keys(packagejson.dependencies).map(function (dep) {
|
||||||
|
return dep + '/**/*';
|
||||||
|
}),
|
||||||
dest: 'build/node_modules/',
|
dest: 'build/node_modules/',
|
||||||
expand: true
|
expand: true
|
||||||
}]
|
}]
|
||||||
|
|
@ -384,7 +387,7 @@ module.exports = function (grunt) {
|
||||||
grunt.registerTask('default', ['newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']);
|
grunt.registerTask('default', ['newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']);
|
||||||
|
|
||||||
if (!IS_WINDOWS && !IS_LINUX) {
|
if (!IS_WINDOWS && !IS_LINUX) {
|
||||||
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64', 'shell:linux_zip']);
|
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'compress', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64', 'shell:linux_zip']);
|
||||||
}else if (IS_LINUX) {
|
}else if (IS_LINUX) {
|
||||||
if (linuxpackage) {
|
if (linuxpackage) {
|
||||||
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'shell:linux_npm', 'electron-packager:build', linuxpackage]);
|
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'shell:linux_npm', 'electron-packager:build', linuxpackage]);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
[people.FrenchBen]
|
[people.FrenchBen]
|
||||||
Name = "Ben French"
|
Name = "Ben French"
|
||||||
Email = "me@frenchben.com"
|
Email = "frenchben@docker.com"
|
||||||
GitHub = "FrenchBen"
|
GitHub = "FrenchBen"
|
||||||
|
|
||||||
[people.jeffdm]
|
[people.jeffdm]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Kitematic",
|
"name": "Kitematic",
|
||||||
"version": "0.10.2",
|
"version": "0.10.4",
|
||||||
"author": "Kitematic",
|
"author": "Kitematic",
|
||||||
"description": "Simple Docker Container management for Mac OS X.",
|
"description": "Simple Docker Container management for Mac OS X.",
|
||||||
"homepage": "https://kitematic.com/",
|
"homepage": "https://kitematic.com/",
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ app.on('ready', function () {
|
||||||
|
|
||||||
mainWindow.loadURL(path.normalize('file://' + path.join(__dirname, 'index.html')));
|
mainWindow.loadURL(path.normalize('file://' + path.join(__dirname, 'index.html')));
|
||||||
|
|
||||||
app.on('activate-with-no-open-windows', function () {
|
app.on('activate', function () {
|
||||||
if (mainWindow) {
|
if (mainWindow) {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,15 @@ var ContainerHome = React.createClass({
|
||||||
let body;
|
let body;
|
||||||
if (this.props.container.Error) {
|
if (this.props.container.Error) {
|
||||||
let error = this.props.container.Error.message;
|
let error = this.props.container.Error.message;
|
||||||
console.log('Err: %o - %o', typeof error, error);
|
if (!error) {
|
||||||
if (error.indexOf('ETIMEDOUT') !== -1) {
|
error = this.props.container.Error;
|
||||||
error = 'Timeout error - Try and restart your VM by running: \n"docker-machine restart default" in a terminal';
|
} else {
|
||||||
}
|
if (error.indexOf('ETIMEDOUT') !== -1) {
|
||||||
if (error.indexOf('ECONNREFUSED') !== -1) {
|
error = 'Timeout error - Try and restart your VM by running: \n"docker-machine restart default" in a terminal';
|
||||||
error = 'Is your VM up and running? Check that "docker ps" works in a terminal.';
|
}
|
||||||
|
if (error.indexOf('ECONNREFUSED') !== -1) {
|
||||||
|
error = 'Is your VM up and running? Check that "docker ps" works in a terminal.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
body = (
|
body = (
|
||||||
<div className="details-progress error">
|
<div className="details-progress error">
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import _ from 'underscore';
|
||||||
import React from 'react/addons';
|
import React from 'react/addons';
|
||||||
import metrics from '../utils/MetricsUtil';
|
import metrics from '../utils/MetricsUtil';
|
||||||
import ContainerUtil from '../utils/ContainerUtil';
|
import ContainerUtil from '../utils/ContainerUtil';
|
||||||
|
|
@ -11,10 +12,11 @@ var ContainerSettingsAdvanced = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState: function () {
|
getInitialState: function () {
|
||||||
let [tty, openStdin] = ContainerUtil.mode(this.props.container) || [true, true];
|
let [tty, openStdin, privileged] = ContainerUtil.mode(this.props.container) || [true, true, false];
|
||||||
return {
|
return {
|
||||||
tty: tty,
|
tty: tty,
|
||||||
openStdin: openStdin
|
openStdin: openStdin,
|
||||||
|
privileged: privileged
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -22,7 +24,9 @@ var ContainerSettingsAdvanced = React.createClass({
|
||||||
metrics.track('Saved Advanced Options');
|
metrics.track('Saved Advanced Options');
|
||||||
let tty = this.state.tty;
|
let tty = this.state.tty;
|
||||||
let openStdin = this.state.openStdin;
|
let openStdin = this.state.openStdin;
|
||||||
containerActions.update(this.props.container.Name, {Tty: tty, OpenStdin: openStdin});
|
let privileged = this.state.privileged;
|
||||||
|
let hostConfig = _.extend(this.props.container.HostConfig, {Privileged: privileged});
|
||||||
|
containerActions.update(this.props.container.Name, {Tty: tty, OpenStdin: openStdin, HostConfig: hostConfig});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleChangeTty: function () {
|
handleChangeTty: function () {
|
||||||
|
|
@ -37,6 +41,12 @@ var ContainerSettingsAdvanced = React.createClass({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleChangePrivileged: function () {
|
||||||
|
this.setState({
|
||||||
|
privileged: !this.state.privileged
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
if (!this.props.container) {
|
if (!this.props.container) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -49,6 +59,7 @@ var ContainerSettingsAdvanced = React.createClass({
|
||||||
<div className="checkboxes">
|
<div className="checkboxes">
|
||||||
<p><input type="checkbox" checked={this.state.tty} onChange={this.handleChangeTty}/>Allocate a TTY for this container</p>
|
<p><input type="checkbox" checked={this.state.tty} onChange={this.handleChangeTty}/>Allocate a TTY for this container</p>
|
||||||
<p><input type="checkbox" checked={this.state.openStdin} onChange={this.handleChangeOpenStdin}/>Keep STDIN open even if not attached</p>
|
<p><input type="checkbox" checked={this.state.openStdin} onChange={this.handleChangeOpenStdin}/>Keep STDIN open even if not attached</p>
|
||||||
|
<p><input type="checkbox" checked={this.state.privileged} onChange={this.handleChangePrivileged}/>Privileged mode</p>
|
||||||
</div>
|
</div>
|
||||||
<a className="btn btn-action" disabled={this.props.container.State.Updating} onClick={this.handleSaveAdvancedOptions}>Save</a>
|
<a className="btn btn-action" disabled={this.props.container.State.Updating} onClick={this.handleSaveAdvancedOptions}>Save</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import ContainerUtil from '../utils/ContainerUtil';
|
||||||
import containerActions from '../actions/ContainerActions';
|
import containerActions from '../actions/ContainerActions';
|
||||||
import containerStore from '../stores/ContainerStore';
|
import containerStore from '../stores/ContainerStore';
|
||||||
import metrics from '../utils/MetricsUtil';
|
import metrics from '../utils/MetricsUtil';
|
||||||
|
import docker from '../utils/DockerUtil';
|
||||||
import {webPorts} from '../utils/Util';
|
import {webPorts} from '../utils/Util';
|
||||||
import {DropdownButton, MenuItem} from 'react-bootstrap';
|
import {DropdownButton, MenuItem} from 'react-bootstrap';
|
||||||
|
|
||||||
|
|
@ -13,42 +14,89 @@ var ContainerSettingsPorts = React.createClass({
|
||||||
router: React.PropTypes.func
|
router: React.PropTypes.func
|
||||||
},
|
},
|
||||||
getInitialState: function () {
|
getInitialState: function () {
|
||||||
|
var ports = ContainerUtil.ports(this.props.container);
|
||||||
|
var initialPorts = this.props.container.InitialPorts;
|
||||||
|
ports[''] = {
|
||||||
|
ip: docker.host,
|
||||||
|
url: '',
|
||||||
|
port: '',
|
||||||
|
portType: 'tcp',
|
||||||
|
error: null
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
ports: ContainerUtil.ports(this.props.container)
|
ports: ports,
|
||||||
|
initialPorts: initialPorts
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
handleViewLink: function (url) {
|
handleViewLink: function (url) {
|
||||||
metrics.track('Opened In Browser', {
|
metrics.track('Opened In Browser', {
|
||||||
from: 'settings'
|
from: 'settings'
|
||||||
});
|
});
|
||||||
shell.openExternal(url);
|
shell.openExternal('http://' + url);
|
||||||
},
|
},
|
||||||
handleChangePort: function(key, e) {
|
createEmptyPort: function (ports) {
|
||||||
let ports = this.state.ports;
|
ports[''] = {
|
||||||
let port = e.target.value;
|
ip: docker.host,
|
||||||
|
url: '',
|
||||||
// save updated port
|
port: '',
|
||||||
ports[key] = _.extend(ports[key], {
|
portType: 'tcp'
|
||||||
url: 'http://' + ports[key]['ip'] + ':' + port,
|
};
|
||||||
port: port,
|
document.getElementById('portKey').value = '';
|
||||||
error: null
|
document.getElementById('portValue').value = '';
|
||||||
});
|
},
|
||||||
|
addPort: function () {
|
||||||
|
if (document.getElementById('portKey') != null){
|
||||||
|
var portKey = document.getElementById('portKey').value;
|
||||||
|
var portValue = document.getElementById('portValue').value;
|
||||||
|
var portTypeValue = document.getElementById('portType').textContent;
|
||||||
|
var ports = this.state.ports;
|
||||||
|
if (portKey !== '') {
|
||||||
|
ports[portKey] = {
|
||||||
|
ip: docker.host,
|
||||||
|
url: docker.host + ':' + portValue,
|
||||||
|
port: portValue,
|
||||||
|
portType: portTypeValue.trim(),
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
this.checkPort(ports, portKey, portKey);
|
||||||
|
if (ports[portKey].error === null) {
|
||||||
|
this.createEmptyPort(ports);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ports;
|
||||||
|
},
|
||||||
|
handleAddPort: function (e) {
|
||||||
|
var ports = this.addPort();
|
||||||
|
this.setState({ports: ports});
|
||||||
|
metrics.track('Added Pending Port');
|
||||||
|
},
|
||||||
|
checkPort: function (ports, port, key) {
|
||||||
// basic validation, if number is integer, if its in range, if there
|
// basic validation, if number is integer, if its in range, if there
|
||||||
// is no collision with ports of other containers and also if there is no
|
// is no collision with ports of other containers and also if there is no
|
||||||
// collision with ports for current container
|
// collision with ports for current container
|
||||||
const otherContainers = _.filter(_.values(containerStore.getState().containers), c => c.Name !== this.props.container.Name);
|
const otherContainers = _.filter(_.values(containerStore.getState().containers), c => c.Name !== this.props.container.Name);
|
||||||
const otherPorts = _.flatten(otherContainers.map(container => {
|
const otherPorts = _.flatten(otherContainers.map(container => {
|
||||||
return _.values(container.NetworkSettings.Ports).map(hosts => hosts.map(host => {
|
try {
|
||||||
return {port: host.HostPort, name: container.Name}
|
return _.values(container.NetworkSettings.Ports).map(hosts => hosts.map(host => {
|
||||||
}));
|
return {port: host.HostPort, name: container.Name};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}catch (err) {
|
||||||
|
|
||||||
|
}
|
||||||
})).reduce((prev, pair) => {
|
})).reduce((prev, pair) => {
|
||||||
prev[pair.port] = pair.name;
|
try {
|
||||||
|
prev[pair.port] = pair.name;
|
||||||
|
}catch (err) {
|
||||||
|
|
||||||
|
}
|
||||||
return prev;
|
return prev;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
const duplicates = _.filter(ports, (v, i) => {
|
const duplicates = _.filter(ports, (v, i) => {
|
||||||
return (i != key && _.isEqual(v.port, port));
|
return (i !== key && _.isEqual(v.port, port));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!port.match(/^[0-9]+$/g)) {
|
if (!port.match(/^[0-9]+$/g)) {
|
||||||
|
|
@ -56,12 +104,41 @@ var ContainerSettingsPorts = React.createClass({
|
||||||
} else if (port <= 0 || port > 65535) {
|
} else if (port <= 0 || port > 65535) {
|
||||||
ports[key].error = 'Needs to be in range <1,65535>.';
|
ports[key].error = 'Needs to be in range <1,65535>.';
|
||||||
} else if (otherPorts[port]) {
|
} else if (otherPorts[port]) {
|
||||||
ports[key].error = 'Collision with container "'+ otherPorts[port] +'"';
|
ports[key].error = 'Collision with container "' + otherPorts[port] + '"';
|
||||||
} else if (duplicates.length > 0) {
|
} else if (duplicates.length > 0) {
|
||||||
ports[key].error = 'Collision with another port in this container.';
|
ports[key].error = 'Collision with another port in this container.';
|
||||||
} else if (port == 22 || port == 2376) {
|
} else if (port === 22 || port === 2376) {
|
||||||
ports[key].error = 'Ports 22 and 2376 are reserved ports for Kitematic/Docker.';
|
ports[key].error = 'Ports 22 and 2376 are reserved ports for Kitematic/Docker.';
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleChangePort: function (key, e) {
|
||||||
|
let ports = this.state.ports;
|
||||||
|
let port = e.target.value;
|
||||||
|
// save updated port
|
||||||
|
ports[key] = _.extend(ports[key], {
|
||||||
|
url: 'http://' + ports[key].ip + ':' + port,
|
||||||
|
port: port,
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
this.checkPort(ports, port, key);
|
||||||
|
|
||||||
|
this.setState({ports: ports});
|
||||||
|
},
|
||||||
|
handleChangePortKey: function (key, e) {
|
||||||
|
let ports = this.state.ports;
|
||||||
|
let portKey = e.target.value;
|
||||||
|
|
||||||
|
// save updated port
|
||||||
|
var currentPort = ports[key];
|
||||||
|
|
||||||
|
delete ports[key];
|
||||||
|
ports[portKey] = currentPort;
|
||||||
|
|
||||||
|
this.setState({ports: ports});
|
||||||
|
},
|
||||||
|
handleRemovePort: function (key, e) {
|
||||||
|
let ports = this.state.ports;
|
||||||
|
delete ports[key];
|
||||||
this.setState({ports: ports});
|
this.setState({ports: ports});
|
||||||
},
|
},
|
||||||
handleChangePortType: function (key, portType) {
|
handleChangePortType: function (key, portType) {
|
||||||
|
|
@ -77,19 +154,37 @@ var ContainerSettingsPorts = React.createClass({
|
||||||
});
|
});
|
||||||
this.setState({ports: ports});
|
this.setState({ports: ports});
|
||||||
},
|
},
|
||||||
|
isInitialPort: function (key, ports) {
|
||||||
|
for (var idx in ports) {
|
||||||
|
if (ports.hasOwnProperty(idx)) {
|
||||||
|
var p = idx.split('/');
|
||||||
|
if (p.length > 0) {
|
||||||
|
if (p[0] === key) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
handleSave: function () {
|
handleSave: function () {
|
||||||
|
let ports = this.state.ports;
|
||||||
|
ports = this.addPort();
|
||||||
|
this.setState({ports: ports});
|
||||||
let exposedPorts = {};
|
let exposedPorts = {};
|
||||||
let portBindings = _.reduce(this.state.ports, (res, value, key) => {
|
let portBindings = _.reduce(ports, (res, value, key) => {
|
||||||
res[key + '/' + value.portType] = [{
|
if (key !== '') {
|
||||||
HostPort: value.port
|
res[key + '/' + value.portType] = [{
|
||||||
}];
|
HostPort: value.port
|
||||||
exposedPorts[key] = {};
|
}];
|
||||||
|
exposedPorts[key + '/' + value.portType] = {};
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
let hostConfig = _.extend(this.props.container.HostConfig, {PortBindings: portBindings});
|
let hostConfig = _.extend(this.props.container.HostConfig, {PortBindings: portBindings});
|
||||||
|
|
||||||
containerActions.update(this.props.container.Name, {ExposedPorts: exposedPorts, HostConfig: hostConfig});
|
containerActions.update(this.props.container.Name, {ExposedPorts: exposedPorts, HostConfig: hostConfig});
|
||||||
|
|
||||||
},
|
},
|
||||||
render: function () {
|
render: function () {
|
||||||
if (!this.props.container) {
|
if (!this.props.container) {
|
||||||
|
|
@ -102,24 +197,37 @@ var ContainerSettingsPorts = React.createClass({
|
||||||
var key = pair[0];
|
var key = pair[0];
|
||||||
var {ip, port, url, portType, error} = pair[1];
|
var {ip, port, url, portType, error} = pair[1];
|
||||||
isValid = (error) ? false : isValid;
|
isValid = (error) ? false : isValid;
|
||||||
let ipLink = (this.props.container.State.Running && !this.props.container.State.Paused && !this.props.container.State.ExitCode && !this.props.container.State.Restarting) ? (<a onClick={this.handleViewLink.bind(this, url)}>{ip}</a>):({ip});
|
let ipLink = (this.props.container.State.Running && !this.props.container.State.Paused && !this.props.container.State.ExitCode && !this.props.container.State.Restarting) ? (<a onClick={this.handleViewLink.bind(this, url)}>{ip}</a>) : ({ip});
|
||||||
|
var icon = '';
|
||||||
|
var portKey = '';
|
||||||
|
var portValue = '';
|
||||||
|
if (key === '') {
|
||||||
|
icon = <td><a disabled={isUpdating} onClick={this.handleAddPort} className="only-icon btn btn-positive small"><span className="icon icon-add"></span></a></td>;
|
||||||
|
portKey = <input id={'portKey' + key} type="text" disabled={isUpdating} defaultValue={key} />;
|
||||||
|
portValue = <input id={'portValue' + key} type="text" disabled={isUpdating} defaultValue={port} />;
|
||||||
|
}else {
|
||||||
|
if (this.isInitialPort(key, this.state.initialPorts)) {
|
||||||
|
icon = <td></td>;
|
||||||
|
}else {
|
||||||
|
icon = <td><a disabled={isUpdating} onClick={this.handleRemovePort.bind(this, key)} className="only-icon btn btn-action small"><span className="icon icon-delete"></span></a></td>;
|
||||||
|
}
|
||||||
|
portKey = <input id={'portKey' + key} type="text" onChange={this.handleChangePortKey.bind(this, key)} disabled={isUpdating} defaultValue={key} />;
|
||||||
|
portValue = <input id={'portValue' + key} type="text" onChange={this.handleChangePort.bind(this, key)} disabled={isUpdating} defaultValue={port} />;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<tr key={key}>
|
<tr key={key}>
|
||||||
<td>{key}</td>
|
<td>{portKey}</td>
|
||||||
<td className="bind">
|
<td className="bind">
|
||||||
{ipLink}:
|
{ipLink}:
|
||||||
<input
|
{portValue}
|
||||||
type="text"
|
|
||||||
disabled={isUpdating}
|
|
||||||
onChange={this.handleChangePort.bind(this, key)}
|
|
||||||
defaultValue={port} />
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<DropdownButton bsStyle="primary" title={portType}>
|
<DropdownButton disabled={isUpdating} id= {'portType' + key } bsStyle="primary" title={portType} >
|
||||||
<MenuItem onSelect={this.handleChangePortType.bind(this, key, 'tcp')} key={key + '-tcp'}>TCP</MenuItem>
|
<MenuItem onSelect={this.handleChangePortType.bind(this, key, 'tcp')} key={key + '-tcp'}>TCP</MenuItem>
|
||||||
<MenuItem onSelect={this.handleChangePortType.bind(this, key, 'udp')} key={key + '-udp'}>UDP</MenuItem>
|
<MenuItem onSelect={this.handleChangePortType.bind(this, key, 'udp')} key={key + '-udp'}>UDP</MenuItem>
|
||||||
</DropdownButton>
|
</DropdownButton>
|
||||||
</td>
|
</td>
|
||||||
|
{icon}
|
||||||
<td className="error">{error}</td>
|
<td className="error">{error}</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,11 @@ var ContainerUtil = {
|
||||||
|
|
||||||
// Provide Foreground options
|
// Provide Foreground options
|
||||||
mode: function (container) {
|
mode: function (container) {
|
||||||
if (!container || !container.Config) {
|
return [
|
||||||
return [true, true];
|
(container && container.Config) ? container.Config.Tty : true,
|
||||||
}
|
(container && container.Config) ? container.Config.OpenStdin : true,
|
||||||
return [container.Config.Tty, container.Config.OpenStdin];
|
(container && container.HostConfig) ? container.HostConfig.Privileged : false
|
||||||
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: inject host here instead of requiring Docker
|
// TODO: inject host here instead of requiring Docker
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ var DockerUtil = {
|
||||||
|
|
||||||
startContainer (name) {
|
startContainer (name) {
|
||||||
let container = this.client.getContainer(name);
|
let container = this.client.getContainer(name);
|
||||||
|
|
||||||
container.start((error) => {
|
container.start((error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
containerServerActions.error({name, error});
|
containerServerActions.error({name, error});
|
||||||
|
|
@ -190,6 +191,14 @@ var DockerUtil = {
|
||||||
containerServerActions.error({name: id, error});
|
containerServerActions.error({name: id, error});
|
||||||
} else {
|
} else {
|
||||||
container.Name = container.Name.replace('/', '');
|
container.Name = container.Name.replace('/', '');
|
||||||
|
this.client.getImage(container.Image).inspect((error, image) => {
|
||||||
|
if (error) {
|
||||||
|
containerServerActions.error({name, error});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
container.InitialPorts = image.Config.ExposedPorts;
|
||||||
|
});
|
||||||
|
|
||||||
containerServerActions.updated({container});
|
containerServerActions.updated({container});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -213,6 +222,13 @@ var DockerUtil = {
|
||||||
this.imagesUsed.push(imgSha);
|
this.imagesUsed.push(imgSha);
|
||||||
}
|
}
|
||||||
container.Name = container.Name.replace('/', '');
|
container.Name = container.Name.replace('/', '');
|
||||||
|
this.client.getImage(container.Image).inspect((error, image) => {
|
||||||
|
if (error) {
|
||||||
|
containerServerActions.error({name, error});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
container.InitialPorts = image.Config.ExposedPorts;
|
||||||
|
});
|
||||||
callback(null, container);
|
callback(null, container);
|
||||||
});
|
});
|
||||||
}, (err, containers) => {
|
}, (err, containers) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue