-
Notifications
You must be signed in to change notification settings - Fork 96
/
Dockerfile.zk
86 lines (74 loc) · 2.12 KB
/
Dockerfile.zk
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM rust:1.79.0 AS base-builder
ENV DEBIAN_FRONTEND=noninteractive
ARG BUILD_FLAGS=""
RUN apt-get update && \
apt-get install -y \
build-essential \
cracklib-runtime \
jq \
clang \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/raiko
# build related files
COPY makefile makefile
COPY script script
RUN ls -al > /tmp/file_list.txt
RUN cat /tmp/file_list.txt
ENV TARGET=risc0
RUN mkdir -p ~/.cargo/bin
RUN echo "Building for risc0"
RUN make install
RUN echo "Building for sp1"
ENV TARGET=sp1
RUN make install
FROM base-builder AS builder
ENV DEBIAN_FRONTEND=noninteractive
ARG BUILD_FLAGS=""
ARG TASKDB=${TASKDB:-raiko-tasks/in-memory}
WORKDIR /opt/raiko
# build related files
COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml
COPY lib lib
COPY provers provers
COPY host host
COPY pipeline pipeline
COPY harness harness
COPY rust-toolchain rust-toolchain
COPY kzg_settings_raw.bin kzg_settings_raw.bin
COPY core core
COPY taskdb taskdb
COPY makefile makefile
COPY script script
RUN ls -al > /tmp/file_list.txt
RUN cat /tmp/file_list.txt
ENV TARGET=risc0
RUN mkdir -p ~/.cargo/bin
RUN echo "Building for risc0"
RUN make guest
RUN echo "Building for sp1"
ENV TARGET=sp1
RUN make guest
RUN cargo build --release ${BUILD_FLAGS} --features "sp1,risc0" --features "docker_build" --features ${TASKDB}
FROM ubuntu:22.04 AS raiko-zk
RUN mkdir -p \
./bin \
/etc/raiko \
/var/log/raiko \
/tmp/risc0-cache
RUN apt-get update && apt-get install -y \
ca-certificates \
openssl \
curl \
jq \
&& rm -rf /var/lib/apt/lists/*
# copy to /etc/raiko, but if self register mode, the mounted one will overwrite it.
COPY --from=builder /opt/raiko/host/config/config.sgx.json /etc/raiko/
COPY --from=builder /opt/raiko/host/config/chain_spec_list_default.json /etc/raiko/chain_spec_list.docker.json
COPY --from=builder /opt/raiko/host/config/chain_spec_list_devnet.json /etc/raiko/chain_spec_list.devnet.json
COPY --from=builder /opt/raiko/target/release/raiko-host /opt/raiko/bin/
WORKDIR /opt/raiko/bin
COPY ./docker/entrypoint.sh /opt/raiko/bin/
ENTRYPOINT [ "/opt/raiko/bin/entrypoint.sh" ]