forked from maliceio/malice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 1.11 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
FROM alpine:3.6
LABEL maintainer "https://github.com/blacktop"
RUN apk add --no-cache file tini
RUN apk add --no-cache -t build-deps go git mercurial build-base gcc file-dev libc-dev \
&& set -x \
&& echo "Building malice Go binary..." \
&& git clone https://github.com/maliceio/malice.git /go/src/github.com/maliceio/malice \
&& cd /go/src/github.com/maliceio/malice \
# fix git redirects
&& git config --global http.https://gopkg.in.followRedirects true \
&& export GOPATH=/go \
&& go version \
&& CGO_ENABLED=0 go build -i -a -installsuffix cgo -ldflags "-X main.Version=$(cat VERSION) -X main.BuildTime=$(date -u +%Y%m%d)" -o /bin/malice \
&& echo "Copy malice config files..." \
&& mkdir /malice \
&& cp /go/src/github.com/maliceio/malice/config/config.toml /malice \
&& cp /go/src/github.com/maliceio/malice/plugins/plugins.toml /malice \
&& rm -rf /go \
&& apk del --purge build-deps
ENV MALICE_STORAGE_PATH /malice
ENV MALICE_IN_DOCKER true
VOLUME ["/malice/config"]
VOLUME ["/malice/samples"]
EXPOSE 80 443
WORKDIR /malice/samples
ENTRYPOINT ["/sbin/tini","--","malice"]
CMD ["--help"]