Skip to content

Commit

Permalink
load deps separate from files in rocksdb dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pirtleshell committed Nov 8, 2023
1 parent 6abc82b commit e8d6338
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Dockerfile-rocksdb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@ RUN git clone https://github.com/facebook/rocksdb.git \
&& make -j$(nproc) install-shared \
&& ldconfig

# Add source files for kava
COPY . kava
WORKDIR /root/kava
# Copy dependency files first to facilitate dependency caching
COPY ./go.mod ./
COPY ./go.sum ./

# Download dependencies
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
go version && go mod download

# Add source files
COPY . .

ARG kava_database_backend=rocksdb
ENV KAVA_DATABASE_BACKEND=$kava_database_backend

# Mount go build and mod caches as container caches, persisted between builder invocations
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
cd kava && make install COSMOS_BUILD_OPTIONS=$KAVA_DATABASE_BACKEND
make install COSMOS_BUILD_OPTIONS=$KAVA_DATABASE_BACKEND


FROM ubuntu:22.04
Expand Down

0 comments on commit e8d6338

Please sign in to comment.