-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile
60 lines (43 loc) · 1.72 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
57
58
59
60
# Stage 1: Base Image
FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS build
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/baking-bad/stone-prover.git /app
WORKDIR /app
COPY . .
# Install dependencies.
RUN ./install_deps.sh
# Build.
RUN bazelisk build //...
FROM build AS test
# Run tests.
RUN bazelisk test //...
# Copy cpu_air_prover and cpu_air_verifier.
RUN ln -s /app/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /bin/cpu_air_prover
RUN ln -s /app/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /bin/cpu_air_verifier
# End to end test.
WORKDIR /app/e2e_test/CairoZero
RUN cairo-compile fibonacci.cairo --output fibonacci_compiled.json --proof_mode
RUN cairo-run \
--program=fibonacci_compiled.json \
--layout=small \
--program_input=fibonacci_input.json \
--air_public_input=fibonacci_public_input.json \
--air_private_input=fibonacci_private_input.json \
--trace_file=fibonacci_trace.json \
--memory_file=fibonacci_memory.json \
--min_steps=512 \
--print_output \
--proof_mode
RUN cpu_air_prover \
--out_file=fibonacci_proof.json \
--private_input_file=fibonacci_private_input.json \
--public_input_file=fibonacci_public_input.json \
--prover_config_file=cpu_air_prover_config.json \
--parameter_file=cpu_air_params.json
RUN cpu_air_verifier --in_file=fibonacci_proof.json && echo "Successfully verified example proof."
# Stage 2: Target Image
FROM debian:stable-slim AS target
COPY --from=build /app/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /usr/bin/
COPY --from=build /app/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /usr/bin/
# Install the necessary runtime dependencies
RUN apt update && apt install -y libdw1