optimize dockerfile caching for go builds
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
e2c48c58d7
commit
4e57b1e0aa
3 changed files with 18 additions and 0 deletions
|
@ -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 .
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue