diff --git a/tools/goctl/docker/template.go b/tools/goctl/docker/template.go index 27f90e47..08e298fe 100644 --- a/tools/goctl/docker/template.go +++ b/tools/goctl/docker/template.go @@ -18,6 +18,7 @@ ENV GOPROXY https://goproxy.cn,direct WORKDIR /build/zero COPY . . +RUN sh -c "[ -f go.mod ]" || exit COPY {{.goRelPath}}/etc /app/etc RUN go build -ldflags="-s -w" -o /app/{{.exeFile}} {{.goRelPath}}/{{.goFile}}