diff options
Diffstat (limited to 'docker/jazzer/Dockerfile')
-rw-r--r-- | docker/jazzer/Dockerfile | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/docker/jazzer/Dockerfile b/docker/jazzer/Dockerfile index bddfcb53..6797b763 100644 --- a/docker/jazzer/Dockerfile +++ b/docker/jazzer/Dockerfile @@ -15,27 +15,28 @@ FROM ubuntu:20.04 AS builder ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y curl git python3 python-is-python3 openjdk-11-jdk-headless +RUN apt-get update && apt-get install -y curl git python3 openjdk-17-jdk-headless WORKDIR /root -RUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 -o /usr/bin/bazelisk && \ +RUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.15.0/bazelisk-linux-amd64 -o /usr/bin/bazelisk && \ chmod +x /usr/bin/bazelisk && \ git clone --depth=1 https://github.com/CodeIntelligenceTesting/jazzer.git && \ cd jazzer && \ # The LLVM toolchain requires ld and ld.gold to exist, but does not use them. touch /usr/bin/ld && \ touch /usr/bin/ld.gold && \ - BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \ - bazelisk build --config=toolchain --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux \ - //agent:jazzer_agent_deploy //driver:jazzer_driver + bazelisk build --config=docker //launcher:jazzer && \ + mkdir -p /app && \ + cp $(bazelisk cquery --config=docker --output=files //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar) /app/jazzer_standalone.jar && \ + cp $(bazelisk cquery --config=docker --output=files //launcher:jazzer) /app/ # :debug includes a busybox shell, which is needed for libFuzzer's use of system() for e.g. the # -fork and -minimize_crash commands. -FROM gcr.io/distroless/java:debug +FROM gcr.io/distroless/java17:debug -COPY --from=builder /root/jazzer/bazel-bin/agent/jazzer_agent_deploy.jar /root/jazzer/bazel-bin/driver/jazzer_driver /app/ +COPY --from=builder /app/* /app/ # system() expects the shell at /bin/sh, but the image has it at /busybox/sh. We create a symlink, # but have to use the long form as a simple RUN <command> also requires /bin/sh. RUN ["/busybox/sh", "-c", "ln -s /busybox/sh /bin/sh"] WORKDIR /fuzzing -ENTRYPOINT [ "/app/jazzer_driver" ] +ENTRYPOINT [ "/app/jazzer" ] |