Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
104 lines (86 loc) · 2.5 KB
/
Copy pathDockerfile
File metadata and controls
104 lines (86 loc) · 2.5 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV TERM=xterm
SHELL ["/bin/bash", "-lc"]
WORKDIR /opt/greed
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
wget \
curl \
git \
sudo \
bash \
file \
pkg-config \
autoconf \
automake \
libtool \
gcc \
g++ \
make \
cmake \
gperf \
bison \
flex \
clang \
build-essential \
doxygen \
mcpp \
zlib1g-dev \
libgmp-dev \
libffi7 \
libffi-dev \
libz3-dev \
libncurses5-dev \
libsqlite3-dev \
libboost-all-dev \
sqlite3 \
genisoimage \
time \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda
ENV CONDA_DIR=/opt/conda
RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
bash /tmp/miniconda.sh -b -p $CONDA_DIR && \
rm -f /tmp/miniconda.sh
ENV PATH=$CONDA_DIR/bin:$PATH
# Accept ToS
RUN conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
# Create Python 3.10 environment
RUN conda create -y -n greed python=3.10 && \
conda clean -afy
# Init conda
RUN conda init bash && \
echo "conda activate greed" >> ~/.bashrc
# Make python/pip default to conda env
ENV CONDA_DEFAULT_ENV=greed
ENV PATH=$CONDA_DIR/envs/greed/bin:$PATH
# Verify
RUN python --version && python3 --version && pip --version
# Install Soufflé 2.4 for Ubuntu 20.04
RUN wget -O /tmp/souffle.deb \
https://github.com/souffle-lang/souffle/releases/download/2.4/x86_64-ubuntu-2004-souffle-2.4-Linux.deb && \
apt-get update && \
apt-get install -y /tmp/souffle.deb && \
rm -f /tmp/souffle.deb && \
rm -rf /var/lib/apt/lists/*
# python virtualenv
ENV CONDA_DEFAULT_ENV=greed
ENV VIRTUAL_ENV=$CONDA_DIR/envs/greed
ENV PATH="$CONDA_DIR/envs/greed/bin:$CONDA_DIR/bin:$PATH"
RUN python --version && python3 --version && pip --version
# Avoid setuptools 81 which breaks ethpwn installation
RUN python -m pip install "setuptools<81"
COPY . /opt/skanf
RUN python -m pip install -r /opt/skanf/requirements.txt
RUN git clone --branch skanf https://github.com/hackingdecentralized/greed-skanf.git /opt/greed
RUN chmod +x /opt/greed/setup.sh
RUN source $CONDA_DIR/etc/profile.d/conda.sh && \
conda activate greed && \
cd /opt/greed && \
bash /opt/greed/setup.sh -j "$(nproc)"
WORKDIR /opt/skanf
CMD ["/bin/bash", "-l"]