-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile2
More file actions
68 lines (51 loc) · 2.33 KB
/
Dockerfile2
File metadata and controls
68 lines (51 loc) · 2.33 KB
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
61
62
63
64
65
66
67
68
FROM rust:1.89-bookworm as build
RUN curl -L https://risczero.com/install | bash
ENV PATH="/root/.risc0/bin:${PATH}"
RUN rzup install rust
# qdpf is for zlib flate
RUN apt update && apt install -y perl qpdf xxd libxml2-utils
COPY data data
COPY host host
COPY verifier verifier
COPY methods methods
COPY Cargo.toml Cargo.lock /
COPY rust-toolchain.toml /
# create directory holding generated Image Id of Computation which will be proved.
RUN mkdir -p /host/out
RUN rm -R /data/test/*.json
WORKDIR /
# Test toolchain installation
RUN rzup show
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo build --release
# creates fake proof for test data, so that calling "verifier" without parameters works
# RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test --release -- --nocapture
#RUN RUST_BACKTRACE=2 RISC0_DEV_MODE=true ./target/release/host show-image-id
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true ./target/release/host --verbose prove-camt53 \
--request=/data/test/test.xml \
--bankkey /data/pub_bank.pem \
--clientkey /data/client.pem \
--witnesskey /data/pub_witness.pem --clientiban CH4308307000289537312
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true ./target/release/host show-image-id > /host/out/IMAGE_ID.hex
#RUN cat /host/out/IMAGE_ID.hex && find /data -type f -name "*-Receipt-*.json"
#COPY host/out/IMAGE_ID.hex /data/IMAGE_ID.hex
#RUN ls && ls /data/test/ && ls data/test/test.xml-Receipt-$(cat ./host/out/IMAGE_ID.hex)-latest.json
# Final Stage -
FROM debian:bookworm-slim as runtime
# qdpf is for zlib flate
RUN apt update && apt install -y perl qpdf xxd libxml2-utils openssl
#FROM alpine:latest as runteim
# add glibc
# RUN apk --no-cache add ca-certificates libgcc gcompat
# Copy the compiled binaries from the build stage
COPY --from=build /target/release/host /app/host
COPY --from=build /target/release/verifier /app/verifier
COPY --from=build /target/riscv-guest/methods/hyperfridge/riscv32im-risc0-zkvm-elf/release/hyperfridge /app/hyperfridge
COPY --from=build /host/out/IMAGE_ID.hex /app/IMAGE_ID.hex
COPY --from=build /data /data
RUN ln -s /app/verifier /usr/local/bin/verifier
RUN ln -s /app/host /usr/local/bin/host
RUN ln -s /app/host /usr/local/bin/fridge
# Check if the proof and testdata is there
RUN ls -la /data/test/test.xml-Receipt-$(cat /app/IMAGE_ID.hex)-latest.json
WORKDIR /app
CMD ["./host", "--help"]