|
|
@ -8,7 +8,8 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e
|
|
|
|
|
|
|
|
|
|
|
|
$scope.formValues = {
|
|
|
|
$scope.formValues = {
|
|
|
|
Console: 'none',
|
|
|
|
Console: 'none',
|
|
|
|
Volumes: []
|
|
|
|
Volumes: [],
|
|
|
|
|
|
|
|
Registry: ''
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$scope.config = {
|
|
|
|
$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 imageNameAndTag = imageName.split(':');
|
|
|
|
|
|
|
|
var image = imageNameAndTag[0];
|
|
|
|
|
|
|
|
if (registry) {
|
|
|
|
|
|
|
|
image = registry + '/' + imageNameAndTag[0];
|
|
|
|
|
|
|
|
}
|
|
|
|
var imageConfig = {
|
|
|
|
var imageConfig = {
|
|
|
|
fromImage: imageNameAndTag[0],
|
|
|
|
fromImage: image,
|
|
|
|
tag: imageNameAndTag[1] ? imageNameAndTag[1] : 'latest'
|
|
|
|
tag: imageNameAndTag[1] ? imageNameAndTag[1] : 'latest'
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return imageConfig;
|
|
|
|
return imageConfig;
|
|
|
@ -116,7 +121,9 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e
|
|
|
|
$('#createContainerSpinner').show();
|
|
|
|
$('#createContainerSpinner').show();
|
|
|
|
|
|
|
|
|
|
|
|
var image = _.toLower(config.Image);
|
|
|
|
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) {
|
|
|
|
Image.create(imageConfig, function (data) {
|
|
|
|
var err = data.length > 0 && data[data.length - 1].hasOwnProperty('error');
|
|
|
|
var err = data.length > 0 && data[data.length - 1].hasOwnProperty('error');
|
|
|
|