From 25206e71cf99d63ff0e79e0f8542fdaffff40d25 Mon Sep 17 00:00:00 2001 From: GP8x Date: Tue, 25 Apr 2017 21:32:27 +0100 Subject: [PATCH] feat(container-creation): add support for ip assignments (#812) --- .../createContainer/createContainerController.js | 14 +++++++++++++- .../createContainer/createcontainer.html | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 0cb2a76dd..09808ad01 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -12,7 +12,9 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai Registry: '', NetworkContainer: '', Labels: [], - ExtraHosts: [] + ExtraHosts: [], + IPv4: '', + IPv6: '' }; $scope.imageConfig = {}; @@ -34,6 +36,9 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai ExtraHosts: [], Devices:[] }, + NetworkingConfig: { + EndpointsConfig: {} + }, Labels: {} }; @@ -267,6 +272,13 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai } config.HostConfig.NetworkMode = networkMode; + config.NetworkingConfig.EndpointsConfig[networkMode] = { + IPAMConfig: { + IPv4Address: $scope.formValues.IPv4, + IPv6Address: $scope.formValues.IPv6 + } + }; + $scope.formValues.ExtraHosts.forEach(function (v) { if (v.value) { config.HostConfig.ExtraHosts.push(v.value); diff --git a/app/components/createContainer/createcontainer.html b/app/components/createContainer/createcontainer.html index cef979453..530ad0f02 100644 --- a/app/components/createContainer/createcontainer.html +++ b/app/components/createContainer/createcontainer.html @@ -350,6 +350,22 @@ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+