From 82d6c2110639cfc7474a116ecbbe00ff144622ac Mon Sep 17 00:00:00 2001 From: Ben Wheatley Date: Tue, 29 Aug 2023 00:18:20 +0100 Subject: [PATCH] dockerfile: Split dependencies stage Make the build slightly quicker, by having a stage which is cached if our dependencies haven't changed. --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 677931fc..872a1d7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,10 @@ FROM golang:1.20.5 as builder WORKDIR /go/src/github.com/gocardless/theatre +# Install dependencies +COPY go.mod go.sum /go/src/github.com/gocardless/theatre/ +RUN go mod download + COPY . /go/src/github.com/gocardless/theatre ARG git_revision=unset RUN echo $git_revision > REVISION