From db1309af835b205d5a708fe4e87020c1d8174dfe Mon Sep 17 00:00:00 2001 From: Mostafa Hussein Date: Tue, 2 Oct 2018 08:45:35 +0200 Subject: [PATCH] Use LABEL and Make use of multistage build Maintainer keyword should be replaced with LABEL, and Also using multistage build decreases the image from 139MB to 117MB Signed-off-by: Mostafa Hussein --- Dockerfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb56a0db..046be1ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM ruby:2.5-alpine -MAINTAINER WPScan Team +FROM ruby:2.5-alpine AS builder +LABEL maintainer="WPScan Team " ARG BUNDLER_ARGS="--jobs=8 --without test development" @@ -19,9 +19,20 @@ RUN apk add --no-cache libcurl procps sqlite-libs && \ WORKDIR /wpscan RUN rake install --trace +FROM ruby:2.5-alpine +LABEL maintainer="WPScan Team , Mostafa Hussein " + +RUN adduser -h /wpscan -g WPScan -D wpscan + +COPY --from=builder /usr/local/bundle /usr/local/bundle +COPY --from=builder /wpscan /wpscan +RUN chown -R wpscan:wpscan /wpscan + +# runtime dependencies +RUN apk add --no-cache libcurl procps sqlite-libs + USER wpscan RUN /usr/local/bundle/bin/wpscan --update --verbose ENTRYPOINT ["/usr/local/bundle/bin/wpscan"] CMD ["--help"] -