From de0110eadf4226d89e8559306152df13cc401c73 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 5 Mar 2021 20:11:01 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20Docker=20=E5=AE=B9=E5=99=A8=E9=99=90?= =?UTF-8?q?=E5=88=B6=20CPU=20=E5=92=8C=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/processes.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/session/processes.go b/session/processes.go index 52353fc..a216f78 100644 --- a/session/processes.go +++ b/session/processes.go @@ -68,8 +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("docker", "run", "--rm", "--name", rid, "-v", filePath+":/"+fileName, conf.DockerImageGo, - "--memory", "64M", "--cpus", "0.1", "/"+fileName) + cmd = exec.Command("docker", "run", "--rm", "--name", rid, "-v", filePath+":/"+fileName, + "--memory", "64M", "--cpus", "0.1", + conf.DockerImageGo, "/"+fileName) } else { cmd = exec.Command(filePath) curDir := filepath.Dir(filePath)