forked from whbjzzwjxq/ZKAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (52 loc) · 1.92 KB
/
Dockerfile
File metadata and controls
60 lines (52 loc) · 1.92 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
ARG UBUNTU_NAME=jammy
ARG UBUNTU_VERSION=22.04
FROM ubuntu:$UBUNTU_VERSION as dev
# See the documentation for supported versions.
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir /zkap
WORKDIR /zkap
# Install basic packages
RUN apt-get update && \
apt-get --yes install --no-install-recommends \
# General-needed
build-essential cmake g++ gcc git gnupg gzip make ninja-build python-is-python3 python3 python3-pip ssh uuid-dev vim wget
# Install LLVM
RUN git clone --depth 1 --branch release/13.x https://github.com/llvm/llvm-project.git
WORKDIR /zkap/llvm-project
RUN cmake -S llvm -B build -G Ninja \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_ASSERTIONS=OFF \
# If you have the out-of-memory problem (<16Gb Memory), add this option.
# -DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_BUILD_TYPE=DEBUG
RUN cmake --build build/
ENV LLVM_PATH=/zkap/llvm-project/build
ENV PATH=${PATH}:${LLVM_PATH}/bin
# Install Detectors
COPY ./detectors /zkap/detectors
RUN ln -s /zkap/detectors llvm/lib/Transforms/detectors
RUN echo "add_subdirectory(detectors)" >> llvm/lib/Transforms/CMakeLists.txt
RUN cmake --build build/
# Install Rust & Circom2llvm
WORKDIR /zkap
RUN apt-get update && \
apt-get --yes install --no-install-recommends \
# Required by rust
curl libffi-dev
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.71.1 -y
ENV CARGO_PATH=/root/.cargo/bin
ENV PATH=${PATH}:${CARGO_PATH}
COPY ./circom2llvm /zkap/circom2llvm
RUN cargo install --path ./circom2llvm/circom2llvm/
COPY ./circomspect /zkap/circomspect
RUN cargo install --path ./circomspect/cli/
# Install python requirements
RUN pip install pandas
# Copy files
COPY ./benchmarks /zkap/benchmarks
COPY ./benchmark_names.txt /zkap/benchmark_names.txt
COPY ./eval_detect.py ./eval_detect.py
COPY ./eval.py ./eval.py
COPY ./utils ./utils
RUN mkdir ./results