gopkg.in/dotcloud/docker.v1@v1.13.1/daemon/exec_linux.go (about) 1 package daemon 2 3 import ( 4 "github.com/docker/docker/container" 5 "github.com/docker/docker/daemon/caps" 6 "github.com/docker/docker/daemon/exec" 7 "github.com/docker/docker/libcontainerd" 8 "github.com/opencontainers/runtime-spec/specs-go" 9 ) 10 11 func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error { 12 if len(ec.User) > 0 { 13 uid, gid, additionalGids, err := getUser(c, ec.User) 14 if err != nil { 15 return err 16 } 17 p.User = &specs.User{ 18 UID: uid, 19 GID: gid, 20 AdditionalGids: additionalGids, 21 } 22 } 23 if ec.Privileged { 24 p.Capabilities = caps.GetAllCapabilities() 25 } 26 return nil 27 }