Skip to content

Commit e1b2151

Browse files
committed
Update Dockerfile to use BenchmarkUtils from its new location, and also
implement a workaround for a security fix implemented by Docker that broke the Docker image build process.
1 parent 3ae585c commit e1b2151

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

VMs/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@ RUN apt-get install -q -y \
1515

1616
RUN mkdir /owasp
1717
WORKDIR /owasp
18+
19+
# Download, build, install Benchmark Utilities required by crawler and scorecard generation
20+
RUN git clone https://github.com/OWASP-Benchmark/BenchmarkUtils.git
21+
WORKDIR /owasp/BenchmarkUtils
22+
RUN mvn install
23+
24+
# Download, build BenchmarkJava
25+
WORKDIR /owasp
1826
RUN git clone https://github.com/OWASP-Benchmark/BenchmarkJava
27+
28+
# Workaround for security fix for CVE-2022-24765
29+
RUN git config --global --add safe.directory /owasp/BenchmarkJava
30+
1931
WORKDIR /owasp/BenchmarkJava
2032
RUN mvn clean package cargo:install
2133

@@ -25,3 +37,8 @@ RUN echo bench:bench | chpasswd
2537
RUN chown -R bench /owasp/
2638
ENV PATH /owasp/BenchmarkJava:$PATH
2739

40+
# start up Benchmark once, for 60 seconds, then kill it, so the additional dependencies required to run it are downloaded/cached in the image as well.
41+
# exit 0 is required to return a 'success' code, otherwise the timeout returns a failure code, causing the Docker build to fail.
42+
WORKDIR /owasp/BenchmarkJava
43+
RUN timeout 60 ./runBenchmark.sh; exit 0
44+

0 commit comments

Comments
 (0)