mirror of https://github.com/portainer/portainer
Added ExtraHosts option.
parent
a80971dd27
commit
fd68039cb9
|
@ -23,7 +23,8 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt
|
|||
CapAdd: [],
|
||||
CapDrop: [],
|
||||
Devices: [],
|
||||
LxcConf: []
|
||||
LxcConf: [],
|
||||
ExtraHosts: []
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -76,6 +77,7 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt
|
|||
prev[cur.name] = cur.value;
|
||||
return prev;
|
||||
}, {});
|
||||
config.HostConfig.ExtraHosts = config.HostConfig.ExtraHosts.map(function(entry) {return entry.host + ':' + entry.ip;});
|
||||
|
||||
var ExposedPorts = {};
|
||||
var PortBindings = {};
|
||||
|
|
|
@ -156,6 +156,7 @@ describe('startContainerController', function() {
|
|||
CapDrop: ['cap_foo_bar'],
|
||||
Devices: [{ 'PathOnHost': '/dev/deviceName', 'PathInContainer': '/dev/deviceName', 'CgroupPermissions': 'mrw'}],
|
||||
LxcConf: {'lxc.utsname':'docker'},
|
||||
ExtraHosts: ['hostname:127.0.0.1'],
|
||||
RestartPolicy: {name: 'always', MaximumRetryCount: 5}
|
||||
},
|
||||
name: 'container-name'
|
||||
|
@ -191,6 +192,7 @@ describe('startContainerController', function() {
|
|||
scope.config.HostConfig.RestartPolicy = {name: 'always', MaximumRetryCount: 5};
|
||||
scope.config.HostConfig.Devices = [{ 'PathOnHost': '/dev/deviceName', 'PathInContainer': '/dev/deviceName', 'CgroupPermissions': 'mrw'}];
|
||||
scope.config.HostConfig.LxcConf = [{name: 'lxc.utsname', value: 'docker'}];
|
||||
scope.config.HostConfig.ExtraHosts = [{host: 'hostname', ip: '127.0.0.1'}];
|
||||
|
||||
scope.create();
|
||||
$httpBackend.flush();
|
||||
|
|
|
@ -226,6 +226,25 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<label>ExtraHosts:</label>
|
||||
<div ng-repeat="entry in config.HostConfig.ExtraHosts">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<label class="sr-only">Hostname:</label>
|
||||
<input type="text" ng-model="entry.host" class="form-control" placeholder="hostname"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only">IP Address:</label>
|
||||
<input type="text" ng-model="entry.ip" class="form-control" placeholder="127.0.0.1"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-danger btn-xs form-control" ng-click="rmEntry(config.HostConfig.ExtraHosts, entry)">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-success btn-sm" ng-click="addEntry(config.HostConfig.ExtraHosts, {host: '', ip: ''})">Add extra host</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>LxcConf:</label>
|
||||
<div ng-repeat="entry in config.HostConfig.LxcConf">
|
||||
|
|
|
@ -526,7 +526,8 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt
|
|||
CapAdd: [],
|
||||
CapDrop: [],
|
||||
Devices: [],
|
||||
LxcConf: []
|
||||
LxcConf: [],
|
||||
ExtraHosts: []
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -579,6 +580,7 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt
|
|||
prev[cur.name] = cur.value;
|
||||
return prev;
|
||||
}, {});
|
||||
config.HostConfig.ExtraHosts = config.HostConfig.ExtraHosts.map(function(entry) {return entry.host + ':' + entry.ip;});
|
||||
|
||||
var ExposedPorts = {};
|
||||
var PortBindings = {};
|
||||
|
@ -1751,6 +1753,25 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t
|
|||
" </div>\n" +
|
||||
" <hr>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label>ExtraHosts:</label>\n" +
|
||||
" <div ng-repeat=\"entry in config.HostConfig.ExtraHosts\">\n" +
|
||||
" <div class=\"form-inline\">\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label class=\"sr-only\">Hostname:</label>\n" +
|
||||
" <input type=\"text\" ng-model=\"entry.host\" class=\"form-control\" placeholder=\"hostname\"/>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label class=\"sr-only\">IP Address:</label>\n" +
|
||||
" <input type=\"text\" ng-model=\"entry.ip\" class=\"form-control\" placeholder=\"127.0.0.1\"/>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <button class=\"btn btn-danger btn-xs form-control\" ng-click=\"rmEntry(config.HostConfig.ExtraHosts, entry)\">Remove</button>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" <button type=\"button\" class=\"btn btn-success btn-sm\" ng-click=\"addEntry(config.HostConfig.ExtraHosts, {host: '', ip: ''})\">Add extra host</button>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label>LxcConf:</label>\n" +
|
||||
" <div ng-repeat=\"entry in config.HostConfig.LxcConf\">\n" +
|
||||
" <div class=\"form-inline\">\n" +
|
||||
|
|
|
@ -774,6 +774,25 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t
|
|||
" </div>\n" +
|
||||
" <hr>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label>ExtraHosts:</label>\n" +
|
||||
" <div ng-repeat=\"entry in config.HostConfig.ExtraHosts\">\n" +
|
||||
" <div class=\"form-inline\">\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label class=\"sr-only\">Hostname:</label>\n" +
|
||||
" <input type=\"text\" ng-model=\"entry.host\" class=\"form-control\" placeholder=\"hostname\"/>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label class=\"sr-only\">IP Address:</label>\n" +
|
||||
" <input type=\"text\" ng-model=\"entry.ip\" class=\"form-control\" placeholder=\"127.0.0.1\"/>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <button class=\"btn btn-danger btn-xs form-control\" ng-click=\"rmEntry(config.HostConfig.ExtraHosts, entry)\">Remove</button>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" <button type=\"button\" class=\"btn btn-success btn-sm\" ng-click=\"addEntry(config.HostConfig.ExtraHosts, {host: '', ip: ''})\">Add extra host</button>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"form-group\">\n" +
|
||||
" <label>LxcConf:</label>\n" +
|
||||
" <div ng-repeat=\"entry in config.HostConfig.LxcConf\">\n" +
|
||||
" <div class=\"form-inline\">\n" +
|
||||
|
|
Loading…
Reference in New Issue