diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 3581e6176..d70676c89 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -8,7 +8,8 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e $scope.formValues = { Console: 'none', - Volumes: [] + Volumes: [], + Registry: '' }; $scope.config = { @@ -103,10 +104,14 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e }); } - function createImageConfig(imageName) { + function createImageConfig(imageName, registry) { var imageNameAndTag = imageName.split(':'); + var image = imageNameAndTag[0]; + if (registry) { + image = registry + '/' + imageNameAndTag[0]; + } var imageConfig = { - fromImage: imageNameAndTag[0], + fromImage: image, tag: imageNameAndTag[1] ? imageNameAndTag[1] : 'latest' }; return imageConfig; @@ -116,7 +121,9 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e $('#createContainerSpinner').show(); var image = _.toLower(config.Image); - var imageConfig = createImageConfig(image); + var registry = _.toLower($scope.formValues.Registry); + var imageConfig = createImageConfig(image, registry); + config.Image = imageConfig.fromImage + ':' + imageConfig.tag; Image.create(imageConfig, function (data) { var err = data.length > 0 && data[data.length - 1].hasOwnProperty('error'); diff --git a/app/components/createContainer/createcontainer.html b/app/components/createContainer/createcontainer.html index 444db30c3..75d60d8ba 100644 --- a/app/components/createContainer/createcontainer.html +++ b/app/components/createContainer/createcontainer.html @@ -18,11 +18,15 @@ - +