浏览代码

check go.mod before build docker image (#225)

Kevin Wan 4 年之前
父节点
当前提交
8d4951c990
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      tools/goctl/docker/template.go

+ 1 - 0
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}}