Browse Source

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

Kevin Wan 4 years ago
parent
commit
8d4951c990
1 changed files with 1 additions and 0 deletions
  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}}