Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
182 lines (152 loc) · 5.57 KB
/
Copy pathDockerfile
File metadata and controls
182 lines (152 loc) · 5.57 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
FROM ubuntu:24.04
ARG UID
ARG GID
ENV LOCAL_UID=${UID}
ENV LOCAL_GID=${GID}
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Kyiv
RUN apt-get update --fix-missing
RUN apt-get upgrade -y
RUN apt-get dist-upgrade -y
RUN apt-get install -y locales && localedef -i en_US -f UTF-8 en_US.UTF-8
# Generate Ukrainian locale
RUN localedef -i uk_UA -f UTF-8 uk_UA.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
RUN apt -y install \
autoconf \
autoconf-archive \
automake \
bison \
bsdmainutils \
build-essential \
ca-certificates \
ccache \
clang-18 \
clangd \
cmake \
curl \
gdb \
gh \
git \
graphviz \
htop \
iproute2 \
iputils-ping \
jq \
libboost-all-dev \
libboost-fiber-dev \
libevent-dev \
liblzma-dev \
libre2-dev \
libssl-dev \
libtool \
libunwind-dev \
libxml2-dev \
libz-dev \
libzstd-dev \
lld-18 \
llvm-18 \
llvm-18-dev \
lsb-release \
lshw \
mc \
mold \
neovim \
net-tools \
netcat-openbsd \
ninja-build \
npm \
pciutils \
pkg-config \
redis-tools \
software-properties-common \
sudo \
telnet \
tmux \
tzdata\
unzip \
valgrind \
vim \
wget \
zlib1g-dev \
zsh
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
RUN apt-get install -y nodejs
RUN corepack enable && corepack prepare yarn@stable --activate
RUN apt-get install -y tk-dev && \
ARCH=$(uname -m) && \
case "$ARCH" in \
x86_64) PBS_ARCH=x86_64-unknown-linux-gnu ;; \
aarch64) PBS_ARCH=aarch64-unknown-linux-gnu ;; \
*) echo "Unsupported arch: $ARCH" && exit 1 ;; \
esac && \
wget "https://github.com/astral-sh/python-build-standalone/releases/download/20241016/cpython-3.10.15+20241016-${PBS_ARCH}-install_only.tar.gz" -O /tmp/python310.tar.gz && \
tar -C /usr/local --strip-components=1 -xf /tmp/python310.tar.gz && \
rm /tmp/python310.tar.gz
# Add memtier_benchmark
RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list && \
apt-get update --fix-missing && \
apt-get install -y memtier-benchmark
# Add Docker repository and install Docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu jammy stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update --fix-missing && \
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Build AFL++ from source with AFL_PERSISTENT_RECORD support
RUN git clone --depth=1 --branch v5.00c https://github.com/AFLplusplus/AFLplusplus.git /opt/AFLplusplus && \
cd /opt/AFLplusplus && \
sed -i 's|// #define AFL_PERSISTENT_RECORD|#define AFL_PERSISTENT_RECORD|' include/config.h && \
make distrib && \
make install && \
cd / && rm -rf /opt/AFLplusplus
# Install Go 1.24.1
RUN ARCH=$(uname -m) && \
case "$ARCH" in \
x86_64) GOARCH=amd64 ;; \
aarch64) GOARCH=arm64 ;; \
*) echo "Unsupported arch: $ARCH" && exit 1 ;; \
esac && \
wget https://go.dev/dl/go1.24.1.linux-${GOARCH}.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.24.1.linux-${GOARCH}.tar.gz && \
rm go1.24.1.linux-${GOARCH}.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
ENV GOPATH=/home/builder/go
ENV PATH=$PATH:$GOPATH/bin
RUN existing_user=$(getent passwd $LOCAL_UID | cut -d: -f1) && \
if [ -n "$existing_user" ]; then \
echo "Removing existing user: $existing_user with UID $LOCAL_UID"; \
deluser --remove-home "$existing_user"; \
fi && \
if [ -n "$LOCAL_GID" ]; then \
if ! getent group $LOCAL_GID > /dev/null; then \
addgroup --gid $LOCAL_GID g${LOCAL_GID}; \
fi; \
adduser --uid $LOCAL_UID --gid $LOCAL_GID --gecos "" --disabled-password --home /home/builder --shell /usr/bin/zsh builder; \
else \
adduser --uid $LOCAL_UID --gecos "" --disabled-password --home /home/builder --shell /usr/bin/zsh builder; \
fi
RUN usermod -aG sudo builder && echo "builder ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/builder
# Add builder to docker group
RUN usermod -aG docker builder
# Configure Docker to run without sudo
RUN mkdir -p /etc/docker && \
echo '{\n "live-restore": true,\n "group": "docker"\n}' > /etc/docker/daemon.json
# Install Rust and Cargo for builder user
USER builder
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
. "$HOME/.cargo/env" && \
cargo install fd-find eza ripgrep bat
RUN python3.10 -m venv /home/builder/.venv && \
/home/builder/.venv/bin/pip install --upgrade pip setuptools wheel
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
USER root
COPY zshrc /home/builder/.zshrc
COPY gitconfig.local /home/builder/.gitconfig.local
COPY colorize_script.py /home/builder/.colorize_script.py
WORKDIR /home/builder