1
0

use docker run --rm ...

This commit is contained in:
dump_stack() 2023-03-16 09:42:07 +00:00
parent 51e4cfec30
commit f10c4165a1
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

2
pew.go
View File

@ -142,7 +142,7 @@ const pathDevNull = "/dev/null"
func dockerRun(timeout time.Duration, container, workdir, command string) ( func dockerRun(timeout time.Duration, container, workdir, command string) (
output string, err error) { output string, err error) {
cmd := exec.Command("docker", "run", "-v", workdir+":/work", cmd := exec.Command("docker", "run", "--rm", "-v", workdir+":/work",
container, "bash", "-c", "cd /work && "+command) container, "bash", "-c", "cd /work && "+command)
timer := time.AfterFunc(timeout, func() { timer := time.AfterFunc(timeout, func() {