-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
56 lines (38 loc) · 1.6 KB
/
Dockerfile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM rust:1-alpine AS chef
RUN rustup install 1.79.0
RUN rustup component add cargo clippy rust-docs rust-std rustc rustfmt
# Use apk for package management in Alpine
RUN apk add --no-cache build-base libressl-dev
RUN cargo install cargo-chef
FROM chef AS planner
WORKDIR /app
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
WORKDIR /app
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
RUN cargo install --git https://github.com/lambdaclass/cairo-vm --rev ed3117098dd33c96056880af6fa67f9b2caebfb4 cairo1-run
RUN cargo build --release -p prover
# Build application
COPY . .
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo build --release -p prover
FROM ghcr.io/cartridge-gg/stone-prover:main AS prover
FROM python:3.9.18-slim-bookworm AS final
WORKDIR /
RUN apt update && apt install -y build-essential libgmp-dev elfutils jq git
RUN pip install --upgrade pip
RUN git clone --depth=1 -b v2.7.0-rc.3 https://github.com/starkware-libs/cairo.git
RUN mv cairo/corelib/ .
RUN rm -rf cairo
RUN pip install cairo-lang==0.13.1
RUN pip install sympy==1.12.1
COPY --from=builder /app/target/release/prover /usr/local/bin/prover
COPY --from=builder /usr/local/cargo/bin/cairo1-run /usr/local/bin/cairo1-run
COPY --from=prover /usr/bin/cpu_air_prover /usr/local/bin/cpu_air_prover
COPY --from=prover /usr/bin/cpu_air_verifier /usr/local/bin/cpu_air_verifier
COPY --from=builder /app/config/cpu_air_prover_config.json /config/cpu_air_prover_config.json
EXPOSE 3000
ENTRYPOINT [ "prover" ]