Merge pull request #10717 from mrunalp/feature/group_add

Adds support for specifying additional groups.
Upstream-commit: 35b02239216d7c976d4b07022429fec25ff9669d
Component: engine
This commit is contained in:
Jessie Frazelle
2015-07-13 17:08:05 -07:00
14 changed files with 48 additions and 0 deletions
@@ -301,6 +301,7 @@ func populateCommand(c *Container, env []string) error {
AutoCreatedDevices: autoCreatedDevices,
CapAdd: c.hostConfig.CapAdd.Slice(),
CapDrop: c.hostConfig.CapDrop.Slice(),
GroupAdd: c.hostConfig.GroupAdd,
ProcessConfig: processConfig,
ProcessLabel: c.GetProcessLabel(),
MountLabel: c.GetMountLabel(),
@@ -170,6 +170,7 @@ type Command struct {
AutoCreatedDevices []*configs.Device `json:"autocreated_devices"`
CapAdd []string `json:"cap_add"`
CapDrop []string `json:"cap_drop"`
GroupAdd []string `json:"group_add"`
ContainerPid int `json:"container_pid"` // the pid for the process inside a container
ProcessConfig ProcessConfig `json:"process_config"` // Describes the init process of the container.
ProcessLabel string `json:"process_label"`
@@ -58,6 +58,8 @@ func (d *driver) createContainer(c *execdriver.Command) (*configs.Config, error)
}
}
container.AdditionalGroups = c.GroupAdd
if c.AppArmorProfile != "" {
container.AppArmorProfile = c.AppArmorProfile
}