-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.standard
37 lines (36 loc) · 1.65 KB
/
Dockerfile.standard
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# syntax = docker/dockerfile:1.2
ARG RUST_VERSION=1.81.0
FROM rust:${RUST_VERSION} as chef
RUN cargo install cargo-chef
FROM chef as planner
WORKDIR /app
COPY . .
RUN cargo chef prepare --bin bonsol-node --recipe-path recipe.json
FROM chef as builder
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
apt-get update --fix-missing && \
apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
software-properties-common \
build-essential
WORKDIR /app/
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --bin bonsol-node --release --recipe-path recipe.json
COPY . .
RUN cargo build --release
FROM rust:${RUST_VERSION}-slim
LABEL org.opencontainers.image.source=https://github.com/anagrambuild/bonsol
LABEL org.opencontainers.image.title="bonsol-node"
LABEL org.opencontainers.image.description="A bonsol proving node"
RUN mkdir -p /usr/opt/bonsol/stark
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common wget ca-certificates libgmp-dev libsodium-dev nasm m4
COPY --from=builder /app/target/release/bonsol-node /usr/opt/bonsol
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify /usr/opt/bonsol/stark/stark_verify
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify.dat /usr/opt/bonsol/stark/stark_verify.dat
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify_final.zkey /usr/opt/bonsol/stark/stark_verify_final.zkey
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /usr/local/sbin/rapidsnark /usr/opt/bonsol/stark/rapidsnark
WORKDIR /usr/opt/bonsol
EXPOSE 9000
ENTRYPOINT ["/usr/opt/bonsol/bonsol-node"]