summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: e13b19daa3b690aa915eab6b39672f6a4300ccb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"]