Browse Source

Download mod.

Alex Myasoedov 2 years ago
parent
commit
fe1908d154
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Dockerfile

+ 4 - 2
Dockerfile

@@ -3,9 +3,11 @@ FROM golang:1.12 AS compiler
 WORKDIR $GOPATH/src/github.com/msoedov/hacker-slides
 
 ENV GO111MODULE on
+RUN go mod download
+
 COPY . .
-RUN GOOS=linux CGO_ENABLE=0 go build  -a -tags netgo -ldflags '-w -extldflags "-static"' -o app *.go
-RUN cp app /bin/app
+RUN GOOS=linux CGO_ENABLE=0 go build  -a -tags netgo -ldflags '-w -extldflags "-static"' -o /bin/app *.go
+
 
 
 FROM alpine:3.8