From 4ee3b0e6bc5f33f23c62c826352c960ae4909797 Mon Sep 17 00:00:00 2001 From: hydroid7 Date: Mon, 23 Nov 2020 20:57:21 +0100 Subject: [PATCH] Makes docker build faster. (#267) * Makes docker build faster. The new dockerfile first pulls the dependecies and in the next step builds the binary. * Reduces number of build layers. --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74322c495b..f5e446d875 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,10 +6,14 @@ ENV GOOS=linux RUN apk add --no-cache make git WORKDIR /go/src/github.com/netlify/gotrue -COPY . /go/src/github.com/netlify/gotrue -RUN make deps build +# Pulling dependencies +COPY ./Makefile ./go.* ./ +RUN make deps +# Building stuff +COPY . /go/src/github.com/netlify/gotrue +RUN make build FROM alpine:3.7 RUN adduser -D -u 1000 netlify