diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index d00b6ebd2..af8b928d6 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -8,7 +8,8 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai Volumes: [], Registry: '', NetworkContainer: '', - Labels: [] + Labels: [], + ExtraHosts: [] }; $scope.imageConfig = {}; @@ -26,7 +27,8 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai PublishAllPorts: false, Binds: [], NetworkMode: 'bridge', - Privileged: false + Privileged: false, + ExtraHosts: [] }, Labels: {} }; @@ -63,6 +65,15 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai $scope.formValues.Labels.splice(index, 1); }; + $scope.addExtraHost = function() { + $scope.formValues.ExtraHosts.push({ value: '' }); + }; + + $scope.removeExtraHost = function(index) { + $scope.formValues.ExtraHosts.splice(index, 1); + }; + + Config.$promise.then(function (c) { var containersToHideLabels = c.hiddenLabels; @@ -231,6 +242,12 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai networkMode += ':' + containerName; } config.HostConfig.NetworkMode = networkMode; + + $scope.formValues.ExtraHosts.forEach(function (v) { + if (v.value) { + config.HostConfig.ExtraHosts.push(v.value); + } + }); } function prepareLabels(config) { diff --git a/app/components/createContainer/createcontainer.html b/app/components/createContainer/createcontainer.html index f052bca3a..47c92b9ed 100644 --- a/app/components/createContainer/createcontainer.html +++ b/app/components/createContainer/createcontainer.html @@ -309,6 +309,31 @@ + +