Skip to content

Commit e758fb8

Browse files
authored
Speed up docker image build by use layer cache (#4038)
* speed up docker image build by use layer cache * rearrenge Dockerfile * enable docker layer cache in github action
1 parent f9d7cb5 commit e758fb8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,11 @@ jobs:
7676
steps:
7777
- uses: actions/checkout@v3
7878
- run: git submodule update --init --recursive --force
79+
80+
# In this step, this action saves a list of existing images,
81+
# the cache is created without them in the post run.
82+
# It also restores the cache if it exists.
83+
- uses: satackey/[email protected]
84+
continue-on-error: false
85+
7986
- run: docker build .

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ FROM docker.io/library/golang:1.18-alpine3.15 AS builder
44
RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++
55

66
WORKDIR /app
7+
8+
# Get dependencies - will also be cached if we won't change go.mod/go.sum
9+
COPY go.mod .
10+
COPY go.sum .
11+
RUN go mod download
12+
13+
714
ADD . .
815

916
RUN make erigon rpcdaemon integration sentry txpool downloader hack observer db-tools

0 commit comments

Comments
 (0)