Skip to content

Commit

Permalink
Made requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
capuanob authored and ForAllSecure Mayhem Bot committed Apr 27, 2024
1 parent f6a1a7f commit c22cb33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
19 changes: 5 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,18 @@ FROM --platform=linux/amd64 ubuntu:20.04 as builder

## Install build dependencies.
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git autoconf automake libboost-all-dev libpcap-dev clang make
DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf automake libboost-all-dev libpcap-dev clang make

## Add source code to the build stage. ADD prevents git clone being cached when it shouldn't
WORKDIR /
ADD https://api.github.com/repos/capuanob/justniffer/git/refs/heads/mayhem version.json
RUN git clone -b mayhem https://github.com/capuanob/justniffer.git
ADD . /justniffer
WORKDIR /justniffer

## Build
RUN ./configure
RUN make -j$(nproc)

## Prepare all library dependencies for copy
RUN mkdir /deps
RUN cp `ldd ./src/justniffer | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | sort | uniq` /deps 2>/dev/null || :

## Package Stage
FROM --platform=linux/amd64 ubuntu:20.04
RUN mkdir -p /tests
COPY --from=builder /justniffer/src/justniffer /justniffer
COPY --from=builder /justniffer/test/*.cap /tests
COPY --from=builder /deps /usr/lib
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y libstdc++6 libgcc-s1 libicu66 zlib1g libbz2-1.0 liblzma5 libzstd1 libpcap0.8 libboost-regex1.71.0 libboost-iostreams1.71.0 libboost-program-options1.71.0

CMD ["/justniffer", "-f", "@@"]
COPY --from=builder /justniffer/src/justniffer /justniffer
3 changes: 1 addition & 2 deletions Mayhemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
image: ghcr.io/capuanob/justniffer-fuzz:latest
project: justniffer
target: justniffer-fuzz
tests:
testsuite:
- file://corpus

cmds:
Expand Down

0 comments on commit c22cb33

Please sign in to comment.