Skip to content

Commit

Permalink
Fix Dockerfile to work with modules
Browse files Browse the repository at this point in the history
Also use the latest Go release to build the code.
  • Loading branch information
rogpeppe committed Sep 11, 2019
1 parent f4f87a3 commit 2df9a07
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
FROM golang:1.12-alpine as builder
FROM golang:1.13-alpine as builder

ADD https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep
RUN apk --no-cache --update add git
WORKDIR $GOPATH/src/github.com/heetch/regula
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure --vendor-only
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /regula ./cmd/regula
WORKDIR /src/regula
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /regula ./cmd/regula
RUN chmod +x /regula
CMD ["/regula"]

Expand Down

0 comments on commit 2df9a07

Please sign in to comment.