Skip to content

Commit

Permalink
docker: speed up docker image build (ethereum#24796)
Browse files Browse the repository at this point in the history
This PR improves the docker build speed for repeated builds where go.mod and go.sum do no change, by placing the downloaded dependencies in a lower layer
  • Loading branch information
eval-exec authored and jagdeep sidhu committed May 5, 2022
1 parent febadf9 commit 31e05f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 31e05f9

Please sign in to comment.