## Dockerfile for the ROSA ICSE'25 artifact.

FROM plumtrie/rosarum:0.2.0 AS rosarum
FROM plumtrie/rosa:0.5.1

LABEL maintainer="dimitri.kokkonis@cea.fr"
LABEL description="Artifact Docker image for the paper \"ROSA: Finding Backdoors with Fuzzing\""


# Copy all of the installed libraries from ROSARUM.
COPY --from=rosarum / /
# Sadly, this breaks something with `apt`. We have to do this little dance to get around the issue.
# See https://askubuntu.com/a/1272402.
RUN rm /var/lib/dpkg/statoverride && \
    rm /var/lib/dpkg/lock && \
    dpkg --configure -a && \
    apt-get --fix-broken install


# Install dependencies for the preeny preloads.
RUN apt-get update && apt-get install -y libseccomp-dev libini-config-dev
# Install dependencies for the artifact scripts.
RUN apt-get update && apt-get install -y texlive-base texlive-publishers latexmk

COPY . /root/artifact
# Build the preeny preloads.
RUN make -C /root/artifact/preeny all
# Build the custom preloads.
RUN make -C /root/artifact/preloads all
# Decompress the D-Link/thttpd fuzzer data.
WORKDIR /root/artifact/data
RUN tar -xzf dlink-backdoored__480mpr_10r_20241031.tar.gz
RUN rm -f dlink-backdoored__480mpr_10r_20241031.tar.gz


WORKDIR /root/artifact
