diff options
| author | Mathieu Deous | 2022-05-02 20:18:23 +0200 |
|---|---|---|
| committer | GitHub | 2022-05-02 20:18:23 +0200 |
| commit | 48936efa96ae17295be4e0a71be3294f0ec6aef8 (patch) | |
| tree | f4e69551f1368aa048edf46b7b061600f3668329 /Dockerfile | |
| parent | bbc738e16f8b637afde58d65196374af98a5e0e2 (diff) | |
Make application go-install-able and create a docker image
Diffstat (limited to '')
| -rw-r--r-- | Dockerfile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e13b19d --- /dev/null +++ b/Dockerfile | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | FROM golang:alpine as build | ||
| 2 | WORKDIR /app | ||
| 3 | |||
| 4 | # install build dependencies | ||
| 5 | RUN apk add --no-cache \ | ||
| 6 | build-base \ | ||
| 7 | automake \ | ||
| 8 | autoconf \ | ||
| 9 | pkgconfig \ | ||
| 10 | libtool \ | ||
| 11 | bison \ | ||
| 12 | libressl-dev \ | ||
| 13 | git | ||
| 14 | |||
| 15 | # install YARA | ||
| 16 | RUN git clone --depth 1 https://github.com/virustotal/yara.git \ | ||
| 17 | && cd yara \ | ||
| 18 | && sh ./build.sh \ | ||
| 19 | && make install \ | ||
| 20 | && cd .. | ||
| 21 | |||
| 22 | # copy and build PMF | ||
| 23 | COPY . . | ||
| 24 | RUN make | ||
| 25 | |||
| 26 | FROM golang:alpine | ||
| 27 | LABEL org.opencontainers.image.source="https://github.com/jvoisin/php-malware-finder" | ||
| 28 | WORKDIR /app | ||
| 29 | |||
| 30 | # install dependencies | ||
| 31 | RUN apk add --no-cache libressl | ||
| 32 | |||
| 33 | # copy files from build container | ||
| 34 | COPY --from=build /usr/local/lib /usr/lib | ||
| 35 | COPY --from=build /app/php-malware-finder /app | ||
| 36 | |||
| 37 | ENTRYPOINT ["/app/php-malware-finder", "-v", "-a", "-c", "/data"] | ||
