9c4570a958
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> Signed-off-by: Anusha Ragunathan <anusha@docker.com>
26 lines
605 B
Go
26 lines
605 B
Go
package daemon
|
|
|
|
import (
|
|
"github.com/docker/docker/container"
|
|
"github.com/docker/docker/daemon/caps"
|
|
"github.com/docker/docker/daemon/exec"
|
|
"github.com/docker/docker/libcontainerd"
|
|
)
|
|
|
|
func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error {
|
|
if len(ec.User) > 0 {
|
|
uid, gid, additionalGids, err := getUser(c, ec.User)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
p.User = &libcontainerd.User{
|
|
UID: uid,
|
|
GID: gid,
|
|
AdditionalGids: additionalGids,
|
|
}
|
|
}
|
|
if ec.Privileged {
|
|
p.Capabilities = caps.GetAllCapabilities()
|
|
}
|
|
return nil
|
|
}
|