-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): rework Dockerfile to use cargo chef (#90)
* Use cargo chef in Dockerfile to prevent frequent full rebuilds * Fix .env loading issue for Docker-based launch ("path not found")
- Loading branch information
1 parent
ae90a2b
commit b1be37c
Showing
4 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ node-modules | |
ledger | ||
.anchor | ||
docker/geyser-outputs | ||
docker/solana-outputs | ||
docker/solana-outputs | ||
snapshot/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
FROM rust:1.83.0 | ||
|
||
RUN apt-get update && apt install -y git curl protobuf-compiler | ||
# This Dockerfile describes the build process for the snapshot | ||
# ETL tool. | ||
|
||
FROM rust:1.83.0-bullseye AS chef | ||
RUN cargo install cargo-chef | ||
WORKDIR /app | ||
|
||
COPY . ./ | ||
FROM chef AS planner | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef AS builder | ||
COPY --from=planner /app/recipe.json recipe.json | ||
RUN apt update && apt install -y git curl protobuf-compiler | ||
# Build dependencies - this is the caching Docker layer! | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
# Build application | ||
COPY . . | ||
RUN cargo build --release --bin solana-snapshot-etl -F standalone | ||
|
||
RUN cargo build --release -p plerkle | ||
FROM debian:bullseye-slim AS runtime | ||
RUN apt update && apt install openssl | ||
WORKDIR /app | ||
COPY --from=builder /app/target/release/solana-snapshot-etl . | ||
|
||
ENTRYPOINT ["cargo", "r", "--features=standalone", "--package=plerkle_snapshot", "--bin=solana-snapshot-etl"] | ||
ENTRYPOINT ["./solana-snapshot-etl"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters