From 624ef3a15238780b86da2dd4a6633e75ee718017 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 18 Jan 2020 17:04:37 +0800 Subject: [PATCH] :art: #3 --- session/processes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/session/processes.go b/session/processes.go index 2006f09..3cf5846 100644 --- a/session/processes.go +++ b/session/processes.go @@ -68,7 +68,9 @@ func RunHandler(w http.ResponseWriter, r *http.Request, channel map[string]*util var cmd *exec.Cmd if conf.Docker { fileName := filepath.Base(filePath) - cmd = exec.Command("sh", "-c \"", "docker run --rm --cpus 0.05 --name "+rid+" -v "+filePath+":/"+fileName+" "+conf.DockerImageGo+" /"+fileName+"\"") + cmdStr := "docker run --rm --cpus 0.05 --name " + rid + " -v " + filePath + ":/" + fileName + " " + conf.DockerImageGo + " /" + fileName + logger.Info(cmdStr) + cmd = exec.Command("sh", "-c", cmdStr) } else { cmd = exec.Command(filePath) curDir := filepath.Dir(filePath)