-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
103 lines (81 loc) · 2.37 KB
/
Copy pathDockerfile
File metadata and controls
103 lines (81 loc) · 2.37 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
FROM ubuntu:24.04 AS fuzztastic-base
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
RUN apt-get update && \
apt-get install -y --no-install-recommends \
# Build tools
build-essential \
cmake \
curl \
file \
git \
golang-go \
libffi-dev \
libssl-dev \
pkg-config \
software-properties-common \
sudo \
unzip \
wget \
# Python
python3 \
python3-dev \
python3-pip \
python3-venv \
# LLVM and Clang
clang-19 \
clang-format-19 \
clang-tidy-19 \
libc++-19-dev \
libc++abi-19-dev \
libclang-rt-19-dev \
libzstd-dev \
llvm-19 \
llvm-19-dev \
llvm-19-tools \
zlib1g-dev \
# FuzzTastic dependencies
rapidjson-dev \
# Utilities
htop \
openssh-client \
tmux \
vim
ENV GOPATH="/opt/go"
RUN go install github.com/SRI-CSL/gllvm/cmd/...@latest
ENV PATH="$GOPATH/bin:$PATH"
ENV POETRY_HOME="/opt/poetry"
ENV POETRY_NO_INTERACTION=1
RUN curl -sSL https://install.python-poetry.org | python3 - && \
chmod +x $POETRY_HOME/bin/poetry
ENV PATH="$POETRY_HOME/bin:$PATH"
RUN ln -sf /usr/bin/clang-19 /usr/bin/clang && \
ln -sf /usr/bin/clang-format-19 /usr/bin/clang-format && \
ln -sf /usr/bin/clang-tidy-19 /usr/bin/clang-tidy && \
ln -sf /usr/bin/clang++-19 /usr/bin/clang++ && \
ln -sf /usr/bin/llc-19 /usr/bin/llc && \
ln -sf /usr/bin/llvm-config-19 /usr/bin/llvm-config && \
ln -sf /usr/bin/llvm-link-19 /usr/bin/llvm-link && \
ln -sf /usr/bin/opt-19 /usr/bin/opt
ENV LLVM_DIR="/usr/lib/llvm-19/lib/cmake/llvm"
ENV CC="/usr/bin/clang"
ENV CXX="/usr/bin/clang++"
ENV FT_RUNTIME_LIB_DIR="/fuzztastic/instrumentation/build/runtime-lib"
ENV LD_LIBRARY_PATH="$FT_RUNTIME_LIB_DIR:$LD_LIBRARY_PATH"
ENV LIBRARY_PATH="$FT_RUNTIME_LIB_DIR:$LIBRARY_PATH"
RUN useradd -m -s /bin/bash user && \
usermod -aG sudo user && \
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER user
WORKDIR /fuzztastic
FROM fuzztastic-base AS fuzztastic-dev
CMD ["sleep", "infinity"]
FROM fuzztastic-base AS fuzztastic
COPY --chown=user:user . .
RUN poetry install --without dev
RUN cd instrumentation && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j
CMD ["/bin/bash"]