Improve caching

This commit is contained in:
2019-03-12 11:11:53 +01:00
parent 7a8f0e5f8c
commit 52f16bf1bc
2 changed files with 19 additions and 3 deletions
+6 -3
View File
@@ -1,9 +1,12 @@
FROM golang:1.11-stretch as builder
FROM golang:1.12 as deps
WORKDIR /build
COPY go.mod go.sum ./
RUN go get
RUN go get -mod=readonly
FROM golang:1.12 as builder
WORKDIR /build
COPY * ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o default-request-adder .
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -a -installsuffix cgo -o default-request-adder .
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/