Compare commits
No commits in common. "b4310c09a86aa1564e786cdb647c3298cdb15fc8" and "b8e46f1e0ff41babc6b52b5054ec14f2be58948e" have entirely different histories.
b4310c09a8
...
b8e46f1e0f
2 changed files with 1 additions and 10 deletions
8
main.go
8
main.go
|
@ -17,8 +17,6 @@ func main() {
|
||||||
config, err := readConfig()
|
config, err := readConfig()
|
||||||
must(err)
|
must(err)
|
||||||
|
|
||||||
must(os.RemoveAll("rootfs/"))
|
|
||||||
|
|
||||||
must(os.MkdirAll("rootfs/etc/apk/keys", 0700))
|
must(os.MkdirAll("rootfs/etc/apk/keys", 0700))
|
||||||
must(os.WriteFile("rootfs/etc/apk/repositories", []byte(
|
must(os.WriteFile("rootfs/etc/apk/repositories", []byte(
|
||||||
`https://dl-cdn.alpinelinux.org/alpine/v3.17/main
|
`https://dl-cdn.alpinelinux.org/alpine/v3.17/main
|
||||||
|
@ -68,8 +66,6 @@ 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...)
|
||||||
|
@ -81,10 +77,6 @@ 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
|
||||||
|
|
|
@ -17,8 +17,7 @@ file repro-run
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo '{"Command": "/src/test", "Cache": ["/home/repro/.cache/go-build"]}
|
echo '{"Command": "/src/test"}' | go run .
|
||||||
' | go run .
|
|
||||||
```
|
```
|
||||||
|
|
||||||
genera
|
genera
|
||||||
|
|
Loading…
Reference in a new issue