forked from kaj/rsass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.mayhem
27 lines (22 loc) · 948 Bytes
/
Dockerfile.mayhem
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
# Use the example in Mayhem Docs as an example/starting point
FROM rust:1.60-buster as builder
RUN cargo install afl
# Add the source code to the image and build the target
ADD . /rsass
WORKDIR /rsass/fuzz
RUN cargo afl build --bin fuzz_rsass_sass
# Built target is: /rsass/fuzz/target/debug/fuzz_rsass_sass
# To get around strange issues with tests, we will remove the tests directory...
RUN rm -rf /rsass/tests && \
mkdir /rsass/tests && \
cp /rsass/fuzz/in/* /rsass/tests
# To simplify matters, we'll copy the compiled target as well as
# the fuzz input folder to a new image with AFL. This helps save some space.
FROM --platform=linux/amd64 rust:1.60-buster
RUN cargo install afl
# Copy the compiled target and the input cases
COPY --from=builder /rsass/fuzz/target/debug/fuzz_rsass_sass /
COPY --from=builder /rsass/fuzz/in /in
# Set to fuzz!
ENTRYPOINT ["cargo", "afl", "fuzz", "-i", "/in", "-o", "/out"]
CMD ["/fuzz_rsass_sass"]