optimize dockerfile caching for go builds

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-06-28 17:09:22 -07:00 committed by Simon Zeltser
parent e2c48c58d7
commit 4e57b1e0aa
3 changed files with 18 additions and 0 deletions

View file

@ -1,7 +1,14 @@
FROM golang:1.10-alpine as builder
RUN apk add --no-cache ca-certificates git
WORKDIR /go/src/checkoutservice
# get known dependencies
RUN go get -d github.com/google/uuid \
google.golang.org/grpc \
google.golang.org/grpc/codes \
google.golang.org/grpc/status
COPY . .
# get remaining dependencies
RUN go get -d ./...
RUN go build -o /checkoutservice .