-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (73 loc) · 1.95 KB
/
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
82
83
84
85
86
FROM ubuntu:latest
SHELL ["/bin/bash", "-c"]
RUN apt-get update
RUN <<EOT
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y \
python3.10 \
python3.10-venv \
python3.10-dev
EOT
# TODO Remove the commented packages
RUN apt-get install -y \
python3 \
python3-pip \
python3-venv \
python3-setuptools \
# libboost-dev \
# libgmp-dev \
# clang-14 \
# llvm-14 \
# cmake \
git \
wget \
# pkg-config \
# ninja-build \
gcc-arm-none-eabi \
sudo \
neovim
WORKDIR /home/ubuntu
RUN python3.10 -m venv venv
RUN venv/bin/pip install \
-U pip \
setuptools \
importlib-resources
# Install Radare2
RUN <<EOT
set -e
git clone https://github.com/radareorg/radare2
cd radare2
./sys/install.sh
set +e
EOT
# Inside psca
COPY . psca
RUN venv/bin/pip install -r psca/requirements.txt
# Download optimathsat
RUN <<EOT
set -e
[ -d psca/omt ] || mkdir psca/omt
cd psca/omt
version="1.7.3"
linux="optimathsat-${version}-linux-64-bit.tar.gz"
wget "https://optimathsat.disi.unitn.it/releases/optimathsat-${version}/${linux}"
tar -xzf ${linux}
macos="optimathsat-${version}-macos-64-bit.tar.gz"
wget "https://optimathsat.disi.unitn.it/releases/optimathsat-${version}/${macos}"
tar -xzf ${macos}
set +e
EOT
RUN <<EOT
PYZ3DIR=$(venv/bin/python -c 'import z3; print(z3.__path__[0])')
echo "export LD_LIBRARY_PATH=\"${PYZ3DIR}/lib\"" >> venv/bin/activate
echo 'export PYTHONPATH="${HOME}/psca/modules/pascal:${HOME}/psca/modules/bv_mc"' >> venv/bin/activate
echo 'source ${HOME}/venv/bin/activate' >> .bashrc
cp psca/src/radare2/.radare2rc .
chown -R ubuntu:ubuntu /home/ubuntu
EOT
RUN usermod -s /bin/bash -p "$(openssl passwd -1 root)" root
RUN usermod -s /bin/bash -p "$(openssl passwd -1 ubuntu)" ubuntu
USER ubuntu
WORKDIR /home/ubuntu/psca