From 406df2ea01598e6b8f6472fbb45416848a4166e2 Mon Sep 17 00:00:00 2001 From: eval-exec Date: Sat, 30 Apr 2022 21:10:16 +0800 Subject: [PATCH] ci: speed up docker image build --- Dockerfile | 5 +++++ Dockerfile.alltools | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index ec46f60773e3..70299190f90f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,11 @@ FROM golang:1.18-alpine as builder RUN apk add --no-cache gcc musl-dev linux-headers git +# Get dependencies - will also be cached if we won't change go.mod/go.sum +COPY go.mod /go-ethereum/ +COPY go.sum /go-ethereum/ +RUN cd /go-ethereum && go mod download + ADD . /go-ethereum RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth diff --git a/Dockerfile.alltools b/Dockerfile.alltools index 683f87a55e7e..b11492cabc9c 100644 --- a/Dockerfile.alltools +++ b/Dockerfile.alltools @@ -8,6 +8,11 @@ FROM golang:1.18-alpine as builder RUN apk add --no-cache gcc musl-dev linux-headers git +# Get dependencies - will also be cached if we won't change go.mod/go.sum +COPY go.mod /go-ethereum/ +COPY go.sum /go-ethereum/ +RUN cd /go-ethereum && go mod download + ADD . /go-ethereum RUN cd /go-ethereum && go run build/ci.go install