From 48936efa96ae17295be4e0a71be3294f0ec6aef8 Mon Sep 17 00:00:00 2001 From: Mathieu Deous Date: Mon, 2 May 2022 20:18:23 +0200 Subject: Make application go-install-able and create a docker image --- Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e13b19d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM golang:alpine as build +WORKDIR /app + +# install build dependencies +RUN apk add --no-cache \ + build-base \ + automake \ + autoconf \ + pkgconfig \ + libtool \ + bison \ + libressl-dev \ + git + +# install YARA +RUN git clone --depth 1 https://github.com/virustotal/yara.git \ + && cd yara \ + && sh ./build.sh \ + && make install \ + && cd .. + +# copy and build PMF +COPY . . +RUN make + +FROM golang:alpine +LABEL org.opencontainers.image.source="https://github.com/jvoisin/php-malware-finder" +WORKDIR /app + +# install dependencies +RUN apk add --no-cache libressl + +# copy files from build container +COPY --from=build /usr/local/lib /usr/lib +COPY --from=build /app/php-malware-finder /app + +ENTRYPOINT ["/app/php-malware-finder", "-v", "-a", "-c", "/data"] -- cgit v1.3