zebra/docker/Dockerfile.build

57 lines
1.4 KiB
Docker
Raw Normal View History

# Builder image
FROM rust:buster as builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
make cmake g++ gcc llvm libclang-dev clang ca-certificates
RUN mkdir /zebra
WORKDIR /zebra
ARG SHORT_SHA
ENV SHORT_SHA $SHORT_SHA
ENV RUST_BACKTRACE full
ENV CARGO_HOME /zebra/.cargo/
RUN rustc -V; cargo -V; rustup -V
COPY . .
2020-12-05 11:45:37 -08:00
RUN cd zebrad/; cargo build --release --features enable-sentry
# Runner image
FROM debian:buster-slim AS zebrad-release
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates
COPY --from=builder /zebra/target/release/zebrad /
ARG CHECKPOINT_SYNC=true
ARG NETWORK=Mainnet
RUN printf "[consensus]\n" >> /zebrad.toml
RUN printf "checkpoint_sync = ${CHECKPOINT_SYNC}\n" >> /zebrad.toml
RUN printf "[metrics]\n" >> /zebrad.toml
RUN printf "endpoint_addr = '0.0.0.0:9999'\n" >> /zebrad.toml
RUN printf "[network]\n" >> /zebrad.toml
RUN printf "network = '${NETWORK}'\n" >> /zebrad.toml
RUN printf "[state]\n" >> /zebrad.toml
RUN printf "cache_dir = '/zebrad-cache'\n" >> /zebrad.toml
RUN printf "[tracing]\n" >> /zebrad.toml
RUN printf "endpoint_addr = '0.0.0.0:3000'\n" >> /zebrad.toml
RUN cat /zebrad.toml
Download Zcash Sapling parameters and load them from cached files (#3057) * Replace Zcash parameters crates with pre-downloaded local parameter files * Download Zcash parameters using the `zcashd` script in CI and Docker * Add a zcash_proofs dependency to zebra-consensus * Download Sapling parameters using zcash_proofs, rather than fetch-params.sh * Add a new `zebrad download` subcommand This command isn't required for nomrmal usage. But it's useful when testing, or launching multiple Zebra instances. * Use `zebrad download` in CI to pre-download parameters * Log a helpful hint if downloading fails * Allow some duplicate dependencies currently hidden by orchard * Spawn a separate task to download Groth16 parameters * Run the parameter download with code coverage This avoids re-compining Zebra with and without coverage. * Update Cargo.lock after rebase * Try to pass `download` as an argument to `zebrad` in coverage CI * Fix copy and paste comment typos * Add path and download examples, like zcash_proofs * Download params in CI just like zcash_proofs does * Delete a redundant build step * Implement graceful shutdown for zebrad start * Send coverage summary to /dev/null when getting the params path * Use the correct parameters path and download commands in CI * Explain pre-downloads * Avoid calling params_folder twice * Rename parameter types and methods for consistency ```sh fastmod SaplingParams SaplingParameters zebra* fastmod Groth16Params Groth16Parameters zebra* fastmod PARAMS GROTH16_PARAMETERS zebra* fastmod params_folder directory zebra* ``` And a manual variable name tweak. * rustfmt * Remove a redundant coverage step Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
2021-11-19 15:02:56 -08:00
# Pre-download Zcash Sprout and Sapling parameters
RUN /zebrad download
EXPOSE 3000 8233 18233
ENV RUST_LOG debug
ENV RUST_BACKTRACE full
ENV SENTRY_DSN https://94059ee72a44420286310990b7c614b5@o485484.ingest.sentry.io/5540918
CMD [ "/zebrad", "-c", "/zebrad.toml", "start" ]