Skip to content

Commit

Permalink
Reduce the go modules rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
mingrammer committed Apr 27, 2019
1 parent 287139b commit 664180b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM golang

ENV CGO_ENABLED=0
ENV GO111MODULE=on
COPY . $GOPATH/src/github.com/flog
WORKDIR $GOPATH/src/github.com/flog
RUN go build -mod=vendor

WORKDIR /go/src/flog

COPY go.mod go.sum ./
RUN go mod download

COPY . ./
RUN go build -o /bin/flog

FROM scratch
COPY --from=0 /go/src/github.com/flog/flog /bin/flog
COPY --from=0 /bin/flog /bin/flog
ENTRYPOINT ["flog"]

0 comments on commit 664180b

Please sign in to comment.