2022-02-08 16:50:13 -08:00
|
|
|
# This steps implement cargo-chef for docker layer caching
|
|
|
|
# This image is for caching Zcash Sprout and Sapling parameters
|
2022-09-26 05:37:23 -07:00
|
|
|
FROM rust:1.63-bullseye as chef
|
2022-02-08 16:50:13 -08:00
|
|
|
RUN cargo install cargo-chef --locked
|
2022-08-03 16:43:32 -07:00
|
|
|
WORKDIR /opt/zebrad
|
2022-02-08 16:50:13 -08:00
|
|
|
|
|
|
|
FROM chef AS planner
|
|
|
|
COPY . .
|
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
|
2022-05-10 14:00:09 -07:00
|
|
|
FROM chef AS release
|
2022-08-03 16:43:32 -07:00
|
|
|
COPY --from=planner /opt/zebrad/recipe.json recipe.json
|
2022-02-08 16:50:13 -08:00
|
|
|
|
|
|
|
# Install zebra build deps
|
|
|
|
RUN apt-get -qq update && \
|
|
|
|
apt-get -qq install -y --no-install-recommends \
|
|
|
|
llvm \
|
|
|
|
libclang-dev \
|
|
|
|
clang \
|
|
|
|
ca-certificates \
|
|
|
|
; \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/*
|
|
|
|
|
2022-08-03 16:43:32 -07:00
|
|
|
ENV CARGO_HOME /opt/zebrad/.cargo/
|
2022-02-08 16:50:13 -08:00
|
|
|
# Build dependencies - this is the caching Docker layer!
|
2022-06-16 12:56:40 -07:00
|
|
|
RUN cargo chef cook --release --features sentry --package zebrad --recipe-path recipe.json
|
2022-02-08 16:50:13 -08:00
|
|
|
|
2022-03-08 07:09:41 -08:00
|
|
|
ARG RUST_BACKTRACE=0
|
2022-02-08 16:50:13 -08:00
|
|
|
ENV RUST_BACKTRACE ${RUST_BACKTRACE}
|
|
|
|
|
2022-03-08 07:09:41 -08:00
|
|
|
ARG RUST_LIB_BACKTRACE=0
|
|
|
|
ENV RUST_LIB_BACKTRACE ${RUST_LIB_BACKTRACE}
|
|
|
|
|
|
|
|
ARG COLORBT_SHOW_HIDDEN=0
|
|
|
|
ENV COLORBT_SHOW_HIDDEN ${COLORBT_SHOW_HIDDEN}
|
|
|
|
|
2022-02-08 16:50:13 -08:00
|
|
|
COPY . .
|
|
|
|
# Pre-download Zcash Sprout and Sapling parameters
|
2022-06-16 12:56:40 -07:00
|
|
|
RUN cargo run --locked --release --features sentry --package zebrad --bin zebrad download
|