From b3532e0a61200ae5fb668727df06762dfa31c6ec Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Wed, 27 Jun 2018 12:05:52 +1000 Subject: [PATCH] Cache devtools and vendor libs in docker --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fed3e42e..c89f0ec1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,16 @@ FROM golang:1.9 as builder WORKDIR /go/src/mikefarah/yq +# cache devtools +COPY ./scripts/devtools.sh /go/src/mikefarah/yq/scripts/devtools.sh +RUN ./scripts/devtools.sh + +# cache vendor +COPY ./vendor/vendor.json /go/src/mikefarah/yq/vendor/vendor.json +RUN govendor sync + COPY . /go/src/mikefarah/yq -RUN scripts/devtools.sh RUN CGO_ENABLED=0 make local build # Choose alpine as a base image to make this useful for CI, as many