-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (64 loc) · 1.98 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
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
# First change to a directory that's not /
WORKDIR /home/ubuntu
# Install all required packages
RUN apt-get update && \
apt-get install -y \
cmake \
meson \
ninja-build \
make \
gcc \
g++ \
curl \
libcurl4-openssl-dev \
vim \
git \
pkg-config \
python3-yaml \
wget \
sudo
# Download, build and install rizin.
RUN wget https://github.com/rizinorg/rizin/archive/refs/tags/v0.7.3.tar.gz && \
tar -xvf v0.7.3.tar.gz && \
cd rizin-0.7.3 && \
meson setup build --prefix=/usr/local --libdir=lib && \
meson compile -C build && \
meson install -C build
# Go back to where we start
WORKDIR /home/ubuntu
# Download, build and install the latest creait library
RUN git clone -b v1 https://github.com/RevEngAI/creait && \
cd creait && \
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=ON && \
ninja -C build && \
ninja -C build install
# Go back to where we start
WORKDIR /home/ubuntu
# Download, build and install latest plugin.
RUN git clone https://github.com/RevEngAI/reai-rz && \
cd reai-rz && \
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX=/usr/local && \
ninja -C build && \
ninja -C build install
# Create a new user and set up a password
RUN useradd -ms /bin/bash revengai && \
echo 'revengai:revengai' | chpasswd
# Optionally, add a sudo capability if needed
RUN echo 'revengai ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# TODO: (FOR THE USER) Create config file
RUN printf "\
host =\"https://api.reveng.ai/v1\"\n \
apikey = \"CHANGEAPIKEYHERE\"\n \
model = \"binnet-0.3\"\n \
db_dir_path = \"/home/revengai/.reai\"\n \
log_dir_path = \"/tmp/reai-rz\"\n \
" > /home/revengai/.reai-rz.toml
RUN printf "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" > /home/revengai/.bashrc
RUN ldconfig
# Change to new created user
USER revengai
WORKDIR /home/revengai
# Ready to use!
CMD ["bash"]