-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.20.04
84 lines (64 loc) · 1.82 KB
/
Dockerfile.20.04
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
########################################
# Base image
########################################
FROM ubuntu:20.04 as base
SHELL ["/bin/bash", "-c"]
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND="noninteractive"
WORKDIR /fuzzer
USER root
RUN apt update
RUN apt install -y --no-install-recommends git
COPY ./stub/packages/20.04/* /opt/packages/
RUN dpkg -i /opt/packages/*; \
apt install -y -f && \
rm -rf /opt/packages
COPY ./stub/get-pip.py ./
RUN python3.7 ./get-pip.py && \
rm get-pip.py
RUN python3.7 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements*.txt ./
RUN pip3 install -r requirements-prod.txt
########################################
# Release image
########################################
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND="noninteractive"
WORKDIR /fuzzer
ARG ENVIRONMENT=dev
ENV ENVIRONMENT=$ENVIRONMENT
RUN apt update && apt install -y ca-certificates
COPY ./stub/packages/20.04/* /opt/packages/
RUN dpkg -i /opt/packages/*; \
apt install -y -f && \
rm -rf /opt/packages
RUN apt update && \
apt -y install \
build-essential \
clang \
git \
llvm && \
#GCC_VERSION=$(apt-cache policy gcc | grep "Installed:" | cut -c 16) && \
GCC_VERSION=$(gcc -dumpversion | egrep -o "^[0-9]+") && \
apt -y install gcc-$GCC_VERSION-plugin-dev && \
# install afl
git clone --depth 1 --branch 4.01c https://github.com/AFLplusplus/AFLplusplus && \
cd ./AFLplusplus && \
make all && \
make install && \
cd .. && \
rm -rf ./AFLplusplus && \
# cleanup
apt -y purge \
build-essential \
git \
gcc-$GCC_VERSION-plugin-dev && \
apt -y autoremove
COPY --from=base /opt/venv /opt/venv
COPY agent ./agent
COPY logging.yaml ./
ENV PATH="/opt/venv/bin:$PATH"
CMD python3 -m agent