-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
executable file
·53 lines (46 loc) · 1.38 KB
/
Dockerfile
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM malice/alpine
LABEL maintainer "https://github.com/blacktop"
ARG HASH=sha1
ENV HASH=$HASH
LABEL malice.plugin.repository = "https://github.com/malice-plugins/nsrl.git"
LABEL malice.plugin.category="intel"
LABEL malice.plugin.mime="hash"
LABEL malice.plugin.docker.engine="*"
COPY shrink_nsrl.sh /nsrl/shrink_nsrl.sh
COPY . /go/src/github.com/malice-plugins/nsrl
RUN apk --update add --no-cache ca-certificates
RUN apk add --no-cache -t .build-deps \
build-base \
mercurial \
musl-dev \
openssl \
p7zip \
unzip \
bash \
wget \
git \
gcc \
dep \
go \
&& set -ex \
&& echo "===> Building info Go binary..." \
&& cd /go/src/github.com/malice-plugins/nsrl \
&& export GOPATH=/go \
&& export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH \
&& export CGO_CFLAGS="-I/usr/local/include" \
&& export CGO_LDFLAGS="-L/usr/local/lib" \
&& go version \
&& dep ensure \
&& go build -ldflags "-s -w -X main.HashType=${HASH} \
-X main.ErrorRate=$(cat ERROR) \
-X main.Version=v$(cat VERSION) \
-X main.BuildTime=$(date -u +%Y%m%d)" -o /bin/nsrl \
&& echo "===> Creating bloomfilter from NSRL database..." \
&& /nsrl/shrink_nsrl.sh \
&& echo "===> Clean up unnecessary files..." \
&& rm -rf /go /usr/local/go /usr/lib/go /tmp/* \
&& apk del --purge .build-deps
VOLUME ["/nsrl"]
WORKDIR /nsrl
ENTRYPOINT ["su-exec","malice","/sbin/tini","--","nsrl"]
CMD ["--help"]