[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request sullo#811 from HuntClauss/fix/docker
Browse files Browse the repository at this point in the history
refactor: reorder docker instructions to benefit from caching
  • Loading branch information
sullo committed Dec 29, 2023
2 parents d1219f7 + 9017550 commit a82a258
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
FROM alpine:3.12

LABEL version="2.1.6" \
LABEL version="2.5.0" \
author="Author Paul Sec (https://github.com/PaulSec), Nikto User https://github.com/drwetter" \
docker_build="docker build -t sullo/nikto:2.1.6 ." \
docker_run_basic="docker run --rm sullo/nikto:2.1.6 -h http://www.example.com" \
docker_run_advanced="docker run --rm -v $(pwd):/tmp sullo/nikto:2.1.6 -h http://www.example.com -o /tmp/out.json"
docker_build="docker build -t sullo/nikto:2.5.0 ." \
docker_run_basic="docker run --rm sullo/nikto:2.5.0 -h http://www.example.com" \
docker_run_advanced="docker run --rm -v $(pwd):/tmp sullo/nikto:2.5.0 -h http://www.example.com -o /tmp/out.json"

COPY ["program/", "/nikto"]

ENV PATH=${PATH}:/nikto

RUN echo 'Installing packages for Nikto.' \
&& apk add --update --no-cache --virtual .build-deps \
RUN echo 'Installing packages for Nikto.'
RUN apk add --update --no-cache --virtual .build-deps \
perl \
perl-net-ssleay \
&& echo 'Creating the nikto group.' \
perl-net-ssleay

RUN echo 'Creating the nikto group.' \
&& addgroup nikto \
&& echo 'Creating the nikto user.' \
&& adduser -G nikto -g "Nikto user" -s /bin/sh -D nikto \
&& echo 'Changing the ownership.' \
&& chown -R nikto.nikto /nikto \
&& echo 'Finishing image.'
&& adduser -G nikto -g "Nikto user" -s /bin/sh -HD nikto

ENV PATH=${PATH}:/opt/nikto
USER nikto

COPY --chown=nikto:nikto ["program/", "/opt/nikto"]
ENTRYPOINT ["nikto.pl"]

0 comments on commit a82a258

Please sign in to comment.