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
This commit is contained in:
EXEC 2022-05-02 12:55:16 +08:00 committed by GitHub
parent f9d7cb5ca9
commit e758fb800b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -76,4 +76,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive --force
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: false
- run: docker build .

View File

@ -4,6 +4,13 @@ FROM docker.io/library/golang:1.18-alpine3.15 AS builder
RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++
WORKDIR /app
# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod .
COPY go.sum .
RUN go mod download
ADD . .
RUN make erigon rpcdaemon integration sentry txpool downloader hack observer db-tools