Skip to content

Commit 40769e3

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 40769e3

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎scanners/nikto/scanner/Dockerfile‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
FROM localhost:5000/sullo/nikto
5+
# ARG scannerVersion is omitted because nikto does not really version its releases
6+
FROM alpine:3.14 as build
7+
RUN apk add git
8+
RUN git clone --depth 1 https://github.com/sullo/nikto.git /nikto
9+
10+
FROM alpine:3.14
11+
ENV PATH=${PATH}:/nikto
12+
COPY --from=build /nikto/program /nikto
613
COPY wrapper.sh /wrapper.sh
14+
RUN apk add --update --no-cache --virtual .build-deps \
15+
perl \
16+
perl-net-ssleay \
17+
&& addgroup nikto \
18+
&& adduser -G nikto -s /bin/sh -D nikto \
19+
&& chown -R nikto.nikto /nikto
720
ENTRYPOINT [ "sh", "/wrapper.sh" ]

0 commit comments

Comments
 (0)