configurar usuario
This commit is contained in:
parent
af3e491626
commit
62b6f98781
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -68,6 +68,8 @@ https://dl-cdn.alpinelinux.org/alpine/v3.17/community`), 0600))
|
||||||
"--ro-bind", ".", "/src",
|
"--ro-bind", ".", "/src",
|
||||||
"--dev-bind", "/dev", "/dev",
|
"--dev-bind", "/dev", "/dev",
|
||||||
"--bind", tmp, "/work",
|
"--bind", tmp, "/work",
|
||||||
|
"--unshare-user", "--uid", "1000", "--gid", "1000",
|
||||||
|
"--setenv", "HOME", "/home/repro",
|
||||||
"--chdir", "/work",
|
"--chdir", "/work",
|
||||||
},
|
},
|
||||||
cachedParams...)
|
cachedParams...)
|
||||||
|
@ -79,6 +81,10 @@ https://dl-cdn.alpinelinux.org/alpine/v3.17/community`), 0600))
|
||||||
// cmd.Stdout = os.Stdout
|
// cmd.Stdout = os.Stdout
|
||||||
// cmd.Stderr = os.Stderr
|
// cmd.Stderr = os.Stderr
|
||||||
must(cmd.Run(), "bwrap apk add")
|
must(cmd.Run(), "bwrap apk add")
|
||||||
|
cmd = exec.Command("bwrap", append(params,
|
||||||
|
"--uid", "0",
|
||||||
|
"adduser", "-u", "1000", "-D", "repro")...)
|
||||||
|
must(cmd.Run(), "bwrap adduser repro")
|
||||||
|
|
||||||
cmd = exec.Command("bwrap", append(params, strings.Split(config.Command, " ")...)...)
|
cmd = exec.Command("bwrap", append(params, strings.Split(config.Command, " ")...)...)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
|
Loading…
Reference in a new issue