diff --git a/src/actions/ContainerActions.js b/src/actions/ContainerActions.js index e5fd4e1dae..d3e5996d4e 100644 --- a/src/actions/ContainerActions.js +++ b/src/actions/ContainerActions.js @@ -2,10 +2,6 @@ import alt from '../alt'; import dockerUtil from '../utils/DockerUtil'; class ContainerActions { - start (name) { - this.dispatch({name}); - dockerUtil.start(name); - } destroy (name) { this.dispatch({name}); @@ -17,14 +13,24 @@ class ContainerActions { dockerUtil.rename(name, newName); } + start (name) { + this.dispatch({name}); + dockerUtil.start(name); + } + stop (name) { this.dispatch({name}); dockerUtil.stop(name); } - update (name, container) { - this.dispatch({name, container}); - dockerUtil.updateContainer(name, container); + restart (name) { + this.dispatch({name}); + dockerUtil.restart(name); + } + + update (name, containerOpts) { + this.dispatch({name, containerOpts}); + dockerUtil.updateContainer(name, containerOpts); } clearPending () { diff --git a/src/components/ContainerDetailsSubheader.react.js b/src/components/ContainerDetailsSubheader.react.js index 9b4cda575f..f5ee477cc7 100644 --- a/src/components/ContainerDetailsSubheader.react.js +++ b/src/components/ContainerDetailsSubheader.react.js @@ -83,7 +83,7 @@ var ContainerDetailsSubheader = React.createClass({ handleRestart: function () { if (!this.disableRestart()) { metrics.track('Restarted Container'); - dockerUtil.restart(this.props.container.Name); + containerActions.restart(this.props.container.Name); } }, handleStop: function () { @@ -223,7 +223,7 @@ var ContainerDetailsSubheader = React.createClass({
Restart - {{startStopToggle}} + {startStopToggle}
Terminal diff --git a/src/utils/DockerUtil.js b/src/utils/DockerUtil.js index 9a7e14c0ae..0ec52f089e 100644 --- a/src/utils/DockerUtil.js +++ b/src/utils/DockerUtil.js @@ -73,6 +73,8 @@ export default { if (containerData.NetworkSettings && containerData.NetworkSettings.Ports) { startopts.PortBindings = containerData.NetworkSettings.Ports; + } else if (containerData.HostConfig && containerData.HostConfig.PortBindings) { + startopts.PortBindings = containerData.HostConfig.PortBindings; } else { startopts.PublishAllPorts = true; }