This commit is contained in:
Liang Ding 2014-12-17 17:30:37 +08:00
parent 9d76269667
commit a9897de8e7
1 changed files with 4 additions and 4 deletions

View File

@ -100,12 +100,12 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
cmd.SysProcAttr = &syscall.SysProcAttr{}
cmd.SysProcAttr.Cloneflags = syscall.CLONE_NEWUSER | syscall.CLONE_NEWNS | syscall.CLONE_NEWUTS | syscall.CLONE_NEWPID | syscall.CLONE_NEWIPC | syscall.CLONE_NEWNET
cmd.SysProcAttr.Credential = &syscall.Credential{
Uid: 1001, // user: wide_runner
Gid: 1001, // gourp: wide_runner
Uid: 0,
Gid: 0,
}
cmd.SysProcAttr.UidMappings = []syscall.SysProcIDMap{{ContainerID: 1001, HostID: 1001, Size: 1}}
cmd.SysProcAttr.GidMappings = []syscall.SysProcIDMap{{ContainerID: 1001, HostID: 1001, Size: 1}}
cmd.SysProcAttr.UidMappings = []syscall.SysProcIDMap{{ContainerID: 0, HostID: 1001, Size: 1}}
cmd.SysProcAttr.GidMappings = []syscall.SysProcIDMap{{ContainerID: 0, HostID: 1001, Size: 1}}
stdout, err := cmd.StdoutPipe()
if nil != err {