From e235c02e1e0b949911212ee024fc882427cc5ba8 Mon Sep 17 00:00:00 2001 From: Kyle Ossinger Date: Wed, 13 Nov 2019 02:56:14 +0000 Subject: Fix docker build The docker build has never worked for me. I fixed all the build errors, mostly due to missing dependencies. I also fixed silent errors that would allow for the build to finish but wouldn't contain features such as python mutators or QEMU's unsigaction module. --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 558968d8..c62cbdab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM ubuntu:eoan MAINTAINER David Carlier LABEL "about"="AFLplusplus docker image" -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apt-get update && apt-get install -y \ + --no-install-suggests --no-install-recommends \ automake \ bison \ build-essential \ @@ -10,18 +11,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ flex \ gcc-9 \ gcc-9-plugin-dev \ + gcc-9-multilib \ libc++-9-dev \ libtool \ libtool-bin \ libglib2.0-dev \ - llvm-9-tools \ + llvm-9-dev \ python-setuptools \ + python2.7-dev \ wget \ + ca-certificates \ + libpixman-1-dev \ && rm -fr /var/lib/apt/lists/* RUN mkdir /app -WORKDIR ["/app"] +WORKDIR /app COPY . . -ENV CC=gcc-9 -ENV CXX=g++-9 -ENV LLVM_CONFIG=llvm-config-9 +ARG CC=gcc-9 +ARG CXX=g++-9 +ARG LLVM_CONFIG=llvm-config-9 RUN make clean && make distrib && make install -- cgit 1.4.1 From 22cfd595efcf8d237beb1d7c707dda8d366b5bed Mon Sep 17 00:00:00 2001 From: Kyle Ossinger Date: Wed, 13 Nov 2019 03:42:39 +0000 Subject: Shaved 600mB off resulting Docker image By removing the build files after the build is complete, we save 600mB of unnecessary bulk. The total image size will now be 1gB. --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c62cbdab..eac468c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,11 +22,10 @@ RUN apt-get update && apt-get install -y \ wget \ ca-certificates \ libpixman-1-dev \ - && rm -fr /var/lib/apt/lists/* -RUN mkdir /app -WORKDIR /app -COPY . . + && rm -rf /var/lib/apt/lists/* ARG CC=gcc-9 ARG CXX=g++-9 ARG LLVM_CONFIG=llvm-config-9 -RUN make clean && make distrib && make install +COPY . /app +RUN cd /app && make clean && make distrib && \ + make install && cd .. && rm -rf /app -- cgit 1.4.1 From 88384c89f356b555163167993da5a806c492d665 Mon Sep 17 00:00:00 2001 From: Kyle Ossinger Date: Wed, 13 Nov 2019 05:33:20 +0000 Subject: Added workdir Last addition I swear. Now you can just run, for example: `docker run --rm -v $PWD:/work -it aflplusplus:latest ./build_script_in_working_dir.sh'. Had forgotten this but figured this would make things easier for folks. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index eac468c8..1947f211 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,3 +29,4 @@ ARG LLVM_CONFIG=llvm-config-9 COPY . /app RUN cd /app && make clean && make distrib && \ make install && cd .. && rm -rf /app +WORKDIR /work -- cgit 1.4.1