mirror of https://github.com/portainer/portainer
feat(templates): allow to set hostname in container templates (#1833)
parent
e8744e8c0b
commit
1e55ada6af
|
@ -1,6 +1,7 @@
|
||||||
function TemplateViewModel(data) {
|
function TemplateViewModel(data) {
|
||||||
this.Type = data.type;
|
this.Type = data.type;
|
||||||
this.Name = data.name;
|
this.Name = data.name;
|
||||||
|
this.Hostname = data.hostname;
|
||||||
this.Title = data.title;
|
this.Title = data.title;
|
||||||
this.Description = data.description;
|
this.Description = data.description;
|
||||||
this.Note = data.note;
|
this.Note = data.note;
|
||||||
|
|
|
@ -314,6 +314,14 @@
|
||||||
<!-- !labels-input-list -->
|
<!-- !labels-input-list -->
|
||||||
</div>
|
</div>
|
||||||
<!-- !Label -->
|
<!-- !Label -->
|
||||||
|
<!-- hostname -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="container_hostname" class="col-sm-2 control-label text-left">Hostname</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="text" name="container_hostname" class="form-control" ng-model="state.selectedTemplate.Hostname" placeholder="leave empty to use docker default">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !hostname -->
|
||||||
</div>
|
</div>
|
||||||
<!-- !advanced-options -->
|
<!-- !advanced-options -->
|
||||||
<!-- actions -->
|
<!-- actions -->
|
||||||
|
|
|
@ -44,7 +44,7 @@ angular.module('portainer.app')
|
||||||
configuration.HostConfig.RestartPolicy = { Name: template.RestartPolicy };
|
configuration.HostConfig.RestartPolicy = { Name: template.RestartPolicy };
|
||||||
configuration.HostConfig.ExtraHosts = template.Hosts ? template.Hosts : [];
|
configuration.HostConfig.ExtraHosts = template.Hosts ? template.Hosts : [];
|
||||||
configuration.name = containerName;
|
configuration.name = containerName;
|
||||||
configuration.Hostname = containerName;
|
configuration.Hostname = template.Hostname;
|
||||||
configuration.Image = template.Image;
|
configuration.Image = template.Image;
|
||||||
configuration.Env = TemplateHelper.EnvToStringArray(template.Env, containerMapping);
|
configuration.Env = TemplateHelper.EnvToStringArray(template.Env, containerMapping);
|
||||||
configuration.Cmd = ContainerHelper.commandStringToArray(template.Command);
|
configuration.Cmd = ContainerHelper.commandStringToArray(template.Command);
|
||||||
|
|
Loading…
Reference in New Issue