-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathruntime.dockerfile
81 lines (67 loc) · 2.17 KB
/
runtime.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Stage 1: Use the stone-prover image to copy the executable
FROM zetina-stone-prover AS zetina-stone-prover
# Stage 2: Use a Debian-based Linux distribution as the base image
FROM debian:stable-slim
# Set the default shell to bash
SHELL ["/bin/bash", "-ci"]
# Install necessary packages for Rust and Python development
RUN apt-get update && apt-get install -y \
curl \
gcc \
libc6-dev \
make \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
python3-openssl \
git \
libgmp-dev \
libdw1 \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
# Install Rust using Rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
echo 'export PATH="/root/.cargo/bin:$PATH"' >> /root/.bashrc
# Install cargo-make and cargo-nextest
RUN cargo install --force cargo-make && \
curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
# Install Pyenv
RUN curl https://pyenv.run | bash && \
echo 'export PATH="/root/.pyenv/bin:$PATH"' >> /root/.bashrc && \
echo 'eval "$(pyenv init -)"' >> /root/.bashrc && \
echo 'eval "$(pyenv virtualenv-init -)"' >> /root/.bashrc
# Install Python 3.9.0 using Pyenv
RUN pyenv install 3.9.0 && \
pyenv global 3.9.0 && \
pyenv --version && \
python -V && \
pip install --upgrade pip
# Add Python and cargo executables to PATH
RUN mkdir -p /root/.local/bin && \
echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.bashrc
# Copy the executable from stone-prover image
COPY --from=zetina-stone-prover /bin/cpu_air_prover /root/.local/bin/
COPY --from=zetina-stone-prover /bin/cpu_air_verifier /root/.local/bin/
# Set the working directory
WORKDIR /zetina
# Copy the current directory content into the container
COPY cairo/ cairo/
COPY requirements.txt requirements.txt
# Install requirements
RUN pip install -r requirements.txt && \
pip install cairo/
# Copy the current directory content into the container
COPY . .
# Build
RUN cargo build --release