2020-11-18 11:41:47 -08:00
|
|
|
# Builder image
|
|
|
|
FROM rust:buster as builder
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2020-12-04 02:07:16 -08:00
|
|
|
make cmake g++ gcc llvm libclang-dev clang ca-certificates
|
2020-11-18 11:41:47 -08:00
|
|
|
|
|
|
|
RUN mkdir /zebra
|
|
|
|
WORKDIR /zebra
|
|
|
|
|
2020-12-03 19:51:42 -08:00
|
|
|
ARG SHORT_SHA
|
|
|
|
ENV SHORT_SHA $SHORT_SHA
|
|
|
|
|
|
|
|
ENV RUST_BACKTRACE full
|
2020-11-18 11:41:47 -08:00
|
|
|
ENV CARGO_HOME /zebra/.cargo/
|
2020-12-03 19:51:42 -08:00
|
|
|
|
2020-11-18 11:41:47 -08:00
|
|
|
RUN rustc -V; cargo -V; rustup -V
|
|
|
|
|
|
|
|
COPY . .
|
2020-12-03 19:51:42 -08:00
|
|
|
|
2020-12-05 11:45:37 -08:00
|
|
|
RUN cd zebrad/; cargo build --release --features enable-sentry
|
2020-11-18 11:41:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
# Runner image
|
|
|
|
FROM debian:buster-slim AS zebrad-release
|
|
|
|
|
2020-12-04 02:54:18 -08:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
ca-certificates
|
|
|
|
|
2020-11-18 11:41:47 -08:00
|
|
|
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
|
2021-01-02 15:11:37 -08:00
|
|
|
RUN printf "[metrics]\n" >> /zebrad.toml
|
|
|
|
RUN printf "endpoint_addr = '0.0.0.0:9999'\n" >> /zebrad.toml
|
2020-11-18 11:41:47 -08:00
|
|
|
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
|
2020-12-03 19:51:42 -08:00
|
|
|
RUN cat /zebrad.toml
|
2020-11-18 11:41:47 -08:00
|
|
|
|
|
|
|
EXPOSE 3000 8233 18233
|
|
|
|
|
2020-12-04 02:07:16 -08:00
|
|
|
ENV RUST_LOG debug
|
2020-11-22 18:19:08 -08:00
|
|
|
ENV RUST_BACKTRACE full
|
2020-12-04 02:07:16 -08:00
|
|
|
ENV SENTRY_DSN https://94059ee72a44420286310990b7c614b5@o485484.ingest.sentry.io/5540918
|
2020-11-22 18:19:08 -08:00
|
|
|
|
2020-11-18 11:41:47 -08:00
|
|
|
CMD [ "/zebrad", "-c", "/zebrad.toml", "start" ]
|