#643 feat(templates): add privileged flag to templates (#644)

pull/645/head
WTFKr0 2017-03-10 15:43:57 +01:00 committed by Anthony Lapenna
parent 082cf5772b
commit f28f223624
2 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,7 @@ function TemplateViewModel(data) {
this.Command = data.command ? data.command : '';
this.Network = data.network ? data.network : '';
this.Env = data.env ? data.env : [];
this.Privileged = data.privileged ? data.privileged : false;
this.Volumes = [];
if (data.volumes) {
this.Volumes = data.volumes.map(function (v) {

View File

@ -37,6 +37,7 @@ angular.module('portainer.services')
service.createContainerConfiguration = function(template, containerName, network, containerMapping) {
var configuration = TemplateHelper.getDefaultContainerConfiguration();
configuration.HostConfig.NetworkMode = network.Name;
configuration.HostConfig.Privileged = template.Privileged;
configuration.name = containerName;
configuration.Image = template.Image;
configuration.Env = TemplateHelper.EnvToStringArray(template.Env, containerMapping);