diff --git a/src/components/ContainerSettingsAdvanced.react.js b/src/components/ContainerSettingsAdvanced.react.js index 6120498c3c..08b8e351b1 100644 --- a/src/components/ContainerSettingsAdvanced.react.js +++ b/src/components/ContainerSettingsAdvanced.react.js @@ -1,3 +1,4 @@ +import _ from 'underscore'; import React from 'react/addons'; import metrics from '../utils/MetricsUtil'; import ContainerUtil from '../utils/ContainerUtil'; @@ -11,10 +12,11 @@ var ContainerSettingsAdvanced = React.createClass({ }, 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 { tty: tty, - openStdin: openStdin + openStdin: openStdin, + privileged: privileged }; }, @@ -22,7 +24,9 @@ var ContainerSettingsAdvanced = React.createClass({ metrics.track('Saved Advanced Options'); let tty = this.state.tty; 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 () { @@ -37,6 +41,12 @@ var ContainerSettingsAdvanced = React.createClass({ }); }, + handleChangePrivileged: function () { + this.setState({ + privileged: !this.state.privileged + }); + }, + render: function () { if (!this.props.container) { return false; @@ -49,6 +59,7 @@ var ContainerSettingsAdvanced = React.createClass({
Allocate a TTY for this container
Keep STDIN open even if not attached
+Privileged mode