This commit is contained in:
Liang Ding 2020-04-19 13:06:57 +08:00
parent 3256f60990
commit e3c3b165c8
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
1 changed files with 1 additions and 3 deletions

View File

@ -68,9 +68,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request, channel map[string]*util
var cmd *exec.Cmd
if conf.Docker {
fileName := filepath.Base(filePath)
//cmdStr := "docker run --rm --cpus 0.5 --name " + rid + " -v " + filePath + ":/" + fileName + " " + conf.DockerImageGo + " /" + fileName
//cmd = exec.Command("sh", "-c", cmdStr)
cmd = exec.Command("docker", "run", "--rm", "--cpus", "0.5", "--name", rid, "-v", filePath+":/"+fileName, conf.DockerImageGo, "/"+fileName)
cmd = exec.Command("docker", "run", "--rm", "--name", rid, "-v", filePath+":/"+fileName, conf.DockerImageGo, "/"+fileName)
} else {
cmd = exec.Command(filePath)
curDir := filepath.Dir(filePath)