-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile_FAQ_2_static_lib.txt
52 lines (40 loc) · 1.97 KB
/
Dockerfile_FAQ_2_static_lib.txt
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
#Basic Image
FROM ubuntu:20.04
#Args for compliance of inner and outer uid and gid
ARG cuid=1000
ARG cgid=1000
ARG cuidname=crusher
ARG cgidname=crusher
#Add group and user (like my HOST group and user)
RUN groupadd -g $cgid $cgidname && useradd -m -u $cuid -g $cgidname -G sudo -s /usr/bin/bash $cuidname
#Just a notes
LABEL maintainer="ponomarev@fobos-nt.ru"
LABEL version="1.0"
LABEL description="net5 coreclr builder for afl Ubuntu 20"
#Set Timezone or get hang during the docker build...
ENV TZ=Europe/Moscow
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#Install common system packages
RUN apt update && apt-get install -y cmake git make sudo wget build-essential python curl gcc lsb-release software-properties-common
#Install clang version 12
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 12
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 100 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 100 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 100 && \
update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-12 100 && \
update-alternatives --install /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-12 100 && \
update-alternatives --install /usr/bin/llvm-nm llvm-nm /usr/bin/llvm-nm-12 100 && \
update-alternatives --install /usr/bin/llvm-ranlib llvm-ranlib /usr/bin/llvm-ranlib-12 100 && \
update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-12 100 && \
update-alternatives --install /usr/bin/llvm-objdump llvm-objdump /usr/bin/llvm-objdump-12 100
#Clone repos
WORKDIR /home/$cuidname
RUN git clone https://github.com/AFLplusplus/AFLplusplus
#Build AFL++
WORKDIR /home/$cuidname/AFLplusplus
RUN make -j4
USER root
#ENV cuidname=$cuidname
#ENV cgidname=$cgidname
CMD /bin/bash