Skip to content

Commit 954fae1

Browse files
committed
Use Multi-Stage-Build For Nikto
As described in #610 the build for nikto was quite complicated and could not be managed via matrix builds on GH. To Fix this I created a multi-stage Dockerfile that clones the nikto repo in the build stage and checks out the specified version. The next stage installs all dependencies like in the Dockerfile provided by the maintainer of nikto, copies nikto from the build stage and our wrapper script. I also noticed that the alpine version was a little behind so I changed it from 3.12 to 3.14 Signed-off-by: Yannik Fuhrmeister <yannik.fuhrmeister@iteratec.com>
1 parent a33cb25 commit 954fae1

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎scanners/nikto/scanner/Dockerfile‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
# SPDX-FileCopyrightText: 2021 iteratec GmbH
22
#
33
# SPDX-License-Identifier: Apache-2.0
4+
ARG scannerVersion
5+
FROM alpine:3.14 as build
6+
RUN apk add git
7+
RUN git clone --depth 1 https://github.com/sullo/nikto.git /nikto \
8+
&& cd /nikto \
9+
&& git checkout $scannerVersion
410

5-
FROM localhost:5000/sullo/nikto
11+
FROM alpine:3.14
12+
ENV PATH=${PATH}:/nikto
13+
COPY --from=build /nikto/program /nikto
614
COPY wrapper.sh /wrapper.sh
15+
RUN apk add --update --no-cache --virtual .build-deps \
16+
perl \
17+
perl-net-ssleay \
18+
&& addgroup nikto \
19+
&& adduser -G nikto -s /bin/sh -D nikto \
20+
&& chown -R nikto.nikto /nikto
721
ENTRYPOINT [ "sh", "/wrapper.sh" ]

0 commit comments

Comments
 (0)